I wrote this on the plane: number theory
Apr. 23rd, 2011 10:51 pmDumb little explorations in number theory. As I've mentioned, I sometimes fall asleep by calculating squares in my head. I go quickly through the ones I have memorized, and hit the higher numbers where the long multiplication starts to put me to sleep. At times I've done variants, like calculating each one twice: first by multiplication, then by taking the last square and adding 2n+1, double checking myself. It's just a way to fill up all my short-term memory registers with numbers so I can't worry about work or delve into the many repulsive attributes of myself.
A couple of nights ago I was extra stressed, and decided to convert each square to base 7. That added enough novelty that I started really low: with 3, whose square is 9, which in base 7 is "12".
And higher and higher. As my extremities started to go numb with falling asleep, I converted 64 into base 7 to get "121" and smiled… sleepily… because that's a square number in base ten, too, of course, and isn't that pretty. I made some kind of math mistake as I converted 81, and then flickered out like a light.
The next night I told
heisenbug my discovery, and then I did the whole thing again, except I thought: hey, maybe I should convert the number to base 7 first and then square it, doing the math in base 7. well, that was pretty damn straightforward. 7 in base seven is "10", which squares to "100" which means 49.
8 in base 7 is "11", which squares to 121:
And of course, of course, 11 will always do that, and so "121" is a square of (base + 1) in pretty much any base. Except base 2 where there is no 2 digit and the addition part of the long multiplication will cause a carry-over.
Likewise, the square of "12" is always going to be "144" as long as there's a 4 digit (base five and up). The square of "13" requires base ten or higher, and the square of 14, well, it already involves a carry-over in base ten. In hex it would, too, so geez… you need base 17.
It would be fun to generalize: if you're squaring a two-digit number, in what base b do you need to be doing the math such that the answer will be the same in all bases b or higher?
A couple of nights ago I was extra stressed, and decided to convert each square to base 7. That added enough novelty that I started really low: with 3, whose square is 9, which in base 7 is "12".
And higher and higher. As my extremities started to go numb with falling asleep, I converted 64 into base 7 to get "121" and smiled… sleepily… because that's a square number in base ten, too, of course, and isn't that pretty. I made some kind of math mistake as I converted 81, and then flickered out like a light.
The next night I told
![[livejournal.com profile]](https://www.dreamwidth.org/img/external/lj-userinfo.gif)
8 in base 7 is "11", which squares to 121:
11 x11 --- 11 11 --- 121
And of course, of course, 11 will always do that, and so "121" is a square of (base + 1) in pretty much any base. Except base 2 where there is no 2 digit and the addition part of the long multiplication will cause a carry-over.
Likewise, the square of "12" is always going to be "144" as long as there's a 4 digit (base five and up). The square of "13" requires base ten or higher, and the square of 14, well, it already involves a carry-over in base ten. In hex it would, too, so geez… you need base 17.
It would be fun to generalize: if you're squaring a two-digit number, in what base b do you need to be doing the math such that the answer will be the same in all bases b or higher?