## Ancient ritual recovered, part 2

How does that method work? Say you have a number $x$ which can be written as $\sum_{i=0}^n 100^ix_i$, where the $x_i$ are positive integers less than 100, that is, they are pairs of digits in $x$. Start with $x_n$ and find the largest digit $a_n$ whose square is no greater than $x_n$, that is, $x_n=a_n^2+r_n$.

Now consider $100x_n+x_{n-1}$, that is, the number formed from the first two pairs of digits in $x$. Its square root is a little more than (or equal to) $10a_n+a_{n-1}$ where $a_{n-1}$ is the largest digit which, appended to $a_n$, gives you a number whose square is no greater than $100x_n+x_{n-1}$. That is, $100x_n+x_{n-1} = (10a_n+a_{n-1})^2+r_{n-1}$. But $(10a_n+a_{n-1})^2 = 100a_n^2+(20a_n+a_{n-1})a_{n-1}$ and so $100r_n+x_{n-1} = (20a_n+a_{n-1})a_{n-1}+r_{n-1}$. The number on the left is just the remainder from the previous step with the next pair of digits from $x$ appended, and the first term on the right is twice the result from the previous step with a new digit appended, multiplied by that new digit. Their difference gives our new remainder, $r_{n-1}$.

Iterate that process and you get each digit $a_n$ of the square root.

## Ancient ritual recovered

Back when I was a kid, probably in middle school I’m guessing, I was taught how to calculate square roots. And then I forgot. At some point I switched over to the algorithm where you enter the number into a calculator and press the square root button. Once in a while I’d recall I used to know how to do it on paper, but the method was gone.

Recently I saw a YouTube video explaining the method, so I got it back. And I’m writing it up here because I have an easier time keeping track of this blog than all the YouTube videos I’ve seen. In fact I’ve lost track of the video already.*

So let’s find the square root of 7252249.

This is going to look kind of like long division. Kind of. Start by putting the number under a square root sign, and separate it into pairs of digits, right to left. (If the number is not an integer, start from the decimal point.) Now look at the leftmost pair of digits. (In this case the number of digits is odd, so the leftmost “pair” is just the 7.) Above it, write the largest single digit whose square is no greater than that pair. Here it’s 2, because 2² < 7 but 3² > 7. Write the square of that digit (4) under the pair, and subtract (3=7-4). Next bring down the next pair, 25, to make the number 325. Take the result so far (2), multiply by 2 (4=2×2), and write that to the left, leaving room for another digit. Now we want the largest single digit such that if we append it to the number we just wrote down on the left, and multiply the result by that digit, it’s no greater than the number on  the right. Here 7 is just barely too large, because 7×47 = 329 which is >325. But 6×46 = 276, which is <325, so put 6 on top and after the 4, put 276 under the 325, and subtract (49=325-276). Lather, rinse, repeat. Bring down the next pair (22) and to the left write the result so far times 2, with room for another digit (52=2×26). The largest digit that will work next is 9, because 9×529=4761 which is <4922. Write that down and subtract (161=4922-4761). Again, bring down the next pair (49), double the result so far and write that on the left (538=2×269). Looks like 3 should work for the next digit and in fact, 3×5383 = 16149 which is exactly what we have, so 7252249 is actually a perfect square, 2693². If it were not a perfect square we could continue by bringing down pairs of zeros after the decimal point and carrying on as before to get as good an approximation as we need.

It’s not as easy as punching a calculator, but that’s not the point. Being able to do this on paper means you’re that much less dependent on machines. It’s amazing the feeling of power it gives you.

* I lied. It’s here: https://www.youtube.com/watch?v=nAZvUnWbS8c