Wondering if anyone knows the rule name for this square observation?

63 Views Asked by At

What is the name or rule for this observation on squares that I've explained below?

If you're at a number, say 400 (m^2) which is a square of 20 (m), and you want to find the square of 25, that is 5 (n) numbers ahead. The square of 25 will be (2 * m * n) + n^2 ahead of m^2.

(25)^2 = 400 + 2 * 20 * 5 + 5^2 = 400 + 200 + 25 = 625

Another example: if you're at a number, say 121 (m^2) which is a square of 11 (m), and you want to find the square of 15, that is 4 (n) numbers ahead.

(15)^2 = 121 + 2 * 11 * 4 + )^2 = 121 + 88 + 16 = 225

This observation will work very well within an algorithm/program where you need to efficiently brute force to find the decimal/float square root of any number, by finding the integer/whole-number square roots of the original number multiplied by powers of 100 in every iteration.