# √ Fun algorithm for finding Perfect Squares √

**URL:** <https://forum.makecode.com/t/fun-algorithm-for-finding-perfect-squares/35156>\
**Category:** Show & Tell\
**Tags:** graphics-and-math\
**Created:** [April 3, 2025, 2:47am UTC](https://forum.makecode.com/t/fun-algorithm-for-finding-perfect-squares/35156 "2025-04-03T02:47:36Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![RobbyZero](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/robbyzero/32/17188_2.png) [@RobbyZero](https://forum.makecode.com/u/RobbyZero)\
**Post date:** [April 3, 2025, 2:47am UTC](https://forum.makecode.com/t/fun-algorithm-for-finding-perfect-squares/35156/1 "2025-04-03T02:47:36Z")

</div>

In square root there is a term called a _perfect square_ a perfect square is a number that can be multiped by two of the same number with no decimals. I realized on my own after looking at a multiplication chart that each _perfect square_ is usually highlighted and the gap between each _perfect square_ is exactly the length of the previous gap plus 2. Using this we can calculate _perfect squares_ without using multiplication functions and it gives us more information. Some information examples are how many _perfect squares_ we can calculate as well as how big the gaps can get.

Presenting:

> **[Perfect Square Finder](https://arcade.makecode.com/S40508-48518-42025-33979)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)\
**Post date:** [April 3, 2025, 2:49am UTC](https://forum.makecode.com/t/fun-algorithm-for-finding-perfect-squares/35156/2 "2025-04-03T02:49:25Z")

</div>

For those of you who are mathematically inclined: Provide a proof for RobbyZero’s statement, “The gap between each perfect square is exactly the length of the previous gap plus 2.”

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [April 3, 2025, 11:44am UTC](https://forum.makecode.com/t/fun-algorithm-for-finding-perfect-squares/35156/3 "2025-04-03T11:44:36Z")

</div>

> **Not good at math but hopefully this informal proof counts lol**
>
> “The gap between each perfect square is exactly the length of the previous gap plus 2.” here’s an example: `25 - 16 = 16 - 9 + 2` which is `5^2 - 4^2 = 4^2 - 3^2 + 2` which we can turn into variable form: `x^2 - (x - 1)^2 = (x - 1)^2 - (x - 2)^2 + 2` which is always true.
> 
> I did the algebra out but I’m too lazy to write it up with LaTeX (mods enable the latex integration maybe please?!?!? 🙏) or post a neat picture so here’s my [Proof by Wolfram Alpha 🤪🤪🤪](https://www.wolframalpha.com/input?i=x%5E2+-+%28x+-+1%29%5E2+%3D+%28x+-+1%29%5E2+-+%28x+-+2%29%5E2+%2B+2).

---

<div class="post-metadata">

**Author:** ![Josef](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/josef/32/12457_2.png) [@Josef](https://forum.makecode.com/u/Josef)\
**Post date:** [April 3, 2025, 12:00pm UTC](https://forum.makecode.com/t/fun-algorithm-for-finding-perfect-squares/35156/5 "2025-04-03T12:00:37Z")

</div>

My…brain cannot comprehend

---

<div class="post-metadata">

**Author:** ![AMakerOfBadGames](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/amakerofbadgames/32/27156_2.png) [@AMakerOfBadGames](https://forum.makecode.com/u/AMakerOfBadGames)\
**Post date:** [April 3, 2025, 4:45pm UTC](https://forum.makecode.com/t/fun-algorithm-for-finding-perfect-squares/35156/6 "2025-04-03T16:45:35Z")

</div>

oh boy I can’t wait to see what the Perfect Square of 1 or 0 is  
(This is still cool regardless)

---

<div class="post-metadata">

**Author:** ![AMakerOfBadGames](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/amakerofbadgames/32/27156_2.png) [@AMakerOfBadGames](https://forum.makecode.com/u/AMakerOfBadGames)\
**Post date:** [April 3, 2025, 4:47pm UTC](https://forum.makecode.com/t/fun-algorithm-for-finding-perfect-squares/35156/7 "2025-04-03T16:47:37Z")

</div>

The +2 thing also works with a different set of numbers on a multiplication table like 2, 6, 12, 20, 30 or 3, 8, 15, 24, 35 as long your going diagonally but to get it to work I’m betting that its going to be messy

> **More Math Warning**
>
> There’s also a way to do it with x^3, x^4, and up but the math gets messier with the higher power number because you have to do another step for one power up you do but the + number is whatever step your one but with ! (5!=5x4x3x2x1=120 or 3!=3x2x1=6 not sure about x^0 though, since 0! = 1)

(But thats a still a neat trick)

---

<div class="post-metadata">

**Author:** ![RobbyZero](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/robbyzero/32/17188_2.png) [@RobbyZero](https://forum.makecode.com/u/RobbyZero)\
**Post date:** [April 3, 2025, 6:43pm UTC](https://forum.makecode.com/t/fun-algorithm-for-finding-perfect-squares/35156/8 "2025-04-03T18:43:14Z")

</div>

I love how many people tried this. Compared to my other math stuff this is probably my most popular math related topic.

---

<div class="post-metadata">

**Author:** ![Josef](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/josef/32/12457_2.png) [@Josef](https://forum.makecode.com/u/Josef)\
**Post date:** [April 7, 2025, 2:48am UTC](https://forum.makecode.com/t/fun-algorithm-for-finding-perfect-squares/35156/9 "2025-04-07T02:48:26Z")

</div>

I made a math game for my brother once…should I share it?

---

<div class="post-metadata">

**Author:** ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)\
**Post date:** [April 7, 2025, 2:48am UTC](https://forum.makecode.com/t/fun-algorithm-for-finding-perfect-squares/35156/10 "2025-04-07T02:48:42Z")

</div>

Absolutely!

---

<div class="post-metadata">

**Author:** ![Josef](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/josef/32/12457_2.png) [@Josef](https://forum.makecode.com/u/Josef)\
**Post date:** [April 7, 2025, 4:58pm UTC](https://forum.makecode.com/t/fun-algorithm-for-finding-perfect-squares/35156/11 "2025-04-07T16:58:01Z")

</div>

> **[math](https://arcade.makecode.com/S58472-29535-42745-71314)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

I made this forever ago. Very simple
