Discrete

A number that is its own square

Square 625 and the answer, 390625, ends in 625. Square 9376 and it ends in 9376. Keep extending them and two endless strings of digits appear, running leftward, each equal to its own square — and their product is nought, though neither is. Base ten does this because ten is two times five: a number in base ten is secretly a pair of numbers, one in base two and one in base five, and these two strings are the pair (one, nought) and (nought, one). In a prime base no such thing can happen.
18 min read 6 figures The same thing twiceSmall cases lie

Worth reading first: Two dials at once · A root lifted one digit at a time.

Numbers that wrap set up arithmetic on a dial: add and multiply as usual, then keep only the remainder. On a dial of 10n10^n, that means keeping the last nn digits. Arithmetic with the last few digits of numbers is arithmetic on such a dial, and every schoolchild who has noticed that the square of a number ending in 5 ends in 25 has been doing it.

Some numbers survive squaring with their last digits intact. 52=255^2 = 25 ends in 5; 252=62525^2 = 625 ends in 25; 6252=390625625^2 = 390625 ends in 625. The same happens on the other side: 62=366^2 = 36 ends in 6, 762=577676^2 = 5776 ends in 76, 3762=141376376^2 = 141376 ends in 376, 93762=879093769376^2 = 87909376 ends in 9376. This essay follows those two families leftward, digit by digit, until they become two infinite strings, and finds that they are a picture of the most useful theorem about dials.

Powers of 5 and 6 until the digits settle. five-adic tail 0896109004106619977392256259918212890625; six tail 9103890995893380022607743740081787109376; settled after 8: 10, 9.
Fig. 1 The last forty digits of 5 squared again and again, and of 6 raised to the fifth power again and again. Strong digits have settled and will never change; faint ones are still moving. One more digit settles at every step.

Four numbers that are their own squares

On a dial of 10n10^n, the equation x2=xx^2 = x asks for numbers whose square ends in the number itself. It has the obvious solutions 00 and 11, and for every nn it has exactly two more.

Four numbers that are their own squares. n=4: 0, 1, 625, 9376.
Fig. 2 The four numbers below 10,000 whose square ends in themselves, placed by their remainders on the dials of 16 and 625. Each is 0 or 1 on each dial, and the four choices give the four solutions.

The reason is two dials at once. The Chinese remainder theorem says that a number on the dial of 10n=2n⋅5n10^n = 2^n \cdot 5^n is the same thing as a pair of numbers, one on the dial of 2n2^n and one on the dial of 5n5^n, and that adding or multiplying on the big dial is adding or multiplying each member of the pair separately. So x2=xx^2 = x on the big dial means x2=xx^2 = x on both small dials at once.

On the dial of a prime power the equation has only the obvious solutions. It says x(x−1)=0x(x - 1) = 0, and xx and x−1x - 1 cannot both be divisible by the prime, since they differ by one; so one of them carries every factor of 2n2^n, or every factor of 5n5^n, and xx is 00 or 11 there. With two dials and two choices on each, there are four solutions on the big dial: (0,0)(0, 0), which is 00; (1,1)(1, 1), which is 11; and the two mixed ones. For four digits these are 06250625, which is 00 on the dial of 625 and 11 on the dial of 16, and 93769376, which is the reverse.

The digits never change once set

Going from nn digits to n+1n + 1, the mixed solutions do not jump about: the new solution ends in the old one. The solution that is 00 modulo 5n+15^{n+1} and 11 modulo 2n+12^{n+1} is in particular 00 modulo 5n5^n and 11 modulo 2n2^n, so its last nn digits are the old solution. Each solution extends the previous one by one digit on the left, and the digits, once written, are permanent.

The two families therefore define two infinite strings of digits running leftward:

…212890625and…787109376.\ldots 212890625 \qquad\text{and}\qquad \ldots 787109376.

Neither is a whole number — a whole number has finitely many digits — but both are ten-adic numbers, the base-ten counterpart of the seven-adic numbers a root lifted one digit at a time built for the square root of two. A ten-adic number is a consistent choice of last digits for every length, and arithmetic on them is arithmetic on all the dials at once: to multiply two of them to nn digits, multiply their last nn digits and keep the last nn digits of the answer.

In that arithmetic, each of the two strings is its own square: squaring changes none of its digits, at any length. Both were reached in the hero figure by repetition, and the way they are reached says something precise about the two primes.

One digit a step, none, or twice as many

Squaring 55 again and again gives 52k5^{2^k}. Its distance from the limit is about whether 52k5^{2^k} is 11 modulo a high power of two, since it is already 00 modulo every power of five it needs. And 52k−15^{2^k} - 1 is divisible by exactly 2k+22^{k+2}: each squaring adds one factor of two, by the identity 52m−1=(5m−1)(5m+1)5^{2m} - 1 = (5^m - 1)(5^m + 1), in which the second factor is twice an odd number. So each squaring settles exactly one more decimal digit.

One digit a step, none, or twice as many. squaring 5: 1,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26; fifth powers of 6: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25; squaring 6: 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1; Newton: 1,2,4,8,16,32,64,128,256,400.
Fig. 3 How many final digits agree with the limit after each step, for squaring 5, raising 6 to the fifth power, squaring 6, and Newton’s method on x2−x=0x^2 - x = 0. Squaring 6 never gets past its last digit; Newton’s method doubles the settled digits at every step.

Squaring 66 does not work at all, which is the surprise in the figure. The powers 6,36,1296,1679616,…6, 36, 1296, 1679616, \ldots end in 66 every time and never settle a second digit. The trouble is on the dial of five: 62k−16^{2^k} - 1 is divisible by 55 exactly once, however many times 66 is squared, because squaring adds factors of two and the obstacle is a factor of five. What works is raising to the fifth power. 65k−16^{5^k} - 1 is divisible by exactly 5k+15^{k+1}, by the same identity with five factors instead of two, and the hero figure’s lower family settles one digit at each fifth power.

The asymmetry is a small instance of a general rule about how powers approach 11 on a prime’s dial — the exponent must keep gaining factors of that prime — and it shows the two dials pulling separately. Each limit is 11 on one dial and 00 on the other, and each iteration has to make progress on the dial where it is 11.

Newton’s method is the efficient alternative. Applied to f(x)=x2−xf(x) = x^2 - x it replaces xx by x−f(x)/f′(x)=x2/(2x−1)x - f(x)/f'(x) = x^2/(2x - 1), and on these dials, as on the dials of a prime in a root lifted one digit at a time, it doubles the number of settled digits at every step: 1,2,4,8,16,32,…1, 2, 4, 8, 16, 32, \ldots, reaching 256 digits in eight steps. The division by 2x−12x - 1 is possible because 2x−12x - 1 is ±1\pm 1 on each small dial, so it has an inverse on the big one.

Why the powers must keep gaining factors

The rule that decided which iterations converge can be stated once and used everywhere. On the dial of a prime power pnp^n, a number aa that is 11 modulo pp — like 55 modulo 22, or 66 modulo 55 — has powers that drift towards 11 only as their exponent gains factors of pp. Precisely, the power of pp dividing am−1a^m - 1 is the power dividing a−1a - 1, plus the power of pp dividing mm — for p=2p = 2 with a small correction when mm is even, which is why the count for 55 starts at k+2k + 2 rather than k+1k + 1. This “lifting the exponent” rule is a cousin of the digit-by-digit lifting of a root lifted one digit at a time: there a root was improved by one digit for each correction, here a power is improved by one digit for each factor of pp in its exponent.

So the exponents 2k2^k gain factors of two and nothing else, which is why squaring helps 55, whose obstacle is the dial of two, and does not help 66, whose obstacle is the dial of five. The exponents 5k5^k gain factors of five, which is why fifth powers rescue 66. An exponent that gains both — 10k10^k — would serve both strings at once: 510k5^{10^k} and 610k6^{10^k} converge as well, settling a digit a step, since the factor of two serves the first and the factor of five the second.

The iterations are fixed-point iterations of the kind the staircase that shows the whole orbit drew for real numbers, with a different notion of nearness. Squaring is the map x↦x2x \mapsto x^2, and its fixed points on the ten-adic numbers are exactly the four solutions. Whether an orbit approaches a fixed point depends on the map’s slope there, measured in the adic sense: at …890625\ldots 890625 the slope 2x2x is 22 times a number that is 11 on the dial of two, so it carries one factor of two, and the orbit approaches at a rate of one binary digit per step on that dial — which, because the dial of five is already satisfied, shows up as one decimal digit per step. At …109376\ldots 109376 the slope is 2x2x again, with no factor of five, and on the dial of five the orbit makes no progress at all.

A powers table that never closes

The same splitting explains a fact about last digits that people meet without explanation. The last digit of n5n^5 is always the last digit of nn, for every nn: 25=322^5 = 32, 35=2433^5 = 243, 75=168077^5 = 16807. On the dial of two, every number is its own fifth power because there are only two numbers; on the dial of five, every number is its own fifth power by Fermat’s little theorem, which every element is a power of one of them placed inside the structure of the dial’s multiplication. Two dials, each satisfied, make the dial of ten satisfied.

The automorphic strings are the extreme case of this. The last digit of n5n^5 equals that of nn for every nn, but the last two digits of n5n^5 equal those of nn only for some, and the last kk digits of n5kn^{5^k}, or of n2kn^{2^k}, settle only for nn that are 00 or 11 on each dial. The table of last digits of powers, extended to more and more digits, is a table that never closes up — except along the four rows that are the four ten-adic solutions of x2=xx^2 = x, where it closes at every length at once.

Two numbers that multiply to nothing

The two strings add up to one and multiply to nought.

Two non-zero numbers whose product is nought. 9103890995893380022607743740081787109376 × 0896109004106619977392256259918212890625 ≡ 0, sum ≡ 1 (mod 10^40).
Fig. 4 The last forty digits of the two ten-adic numbers that are their own squares, multiplied and added digit by digit with the usual carries. The product is all noughts; the sum is one.

The sum is clear from the dials: (1,0)+(0,1)=(1,1)(1, 0) + (0, 1) = (1, 1), which is 11. The product is (1,0)×(0,1)=(0,0)(1, 0) \times (0, 1) = (0, 0), which is 00. In the digits, the product of …109376\ldots 109376 and …890625\ldots 890625 has every last digit nought, to any length one cares to compute, although neither factor ends in a single nought.

In the ordinary integers a product is nought only if a factor is. Numbers on the dial of a prime keep that property, and so do the pp-adic numbers for a prime pp; they form a number system in which division by anything non-zero is possible, which is what made the seven-adic square root of two behave like a real number. The ten-adic numbers do not. They have zero divisors, non-zero numbers whose product is nought, and so they are not a field in the sense of the field with four elements, where every non-zero element can be divided by, and the familiar argument “if ab=0ab = 0 then a=0a = 0 or b=0b = 0” fails in them. It is the failure that occurs on every dial whose size is not a power of a single prime — on the dial of six, 2×3=02 \times 3 = 0 — and that multiplying every number on the dial at once ran into when multiplication by a number sharing a factor with the dial failed to rearrange it; here it is carried out to infinitely many digits.

The two strings make the failure exact. Every ten-adic number xx splits as x=x e+x (1−e)x = x\,e + x\,(1 - e), where e=…109376e = \ldots 109376, and the two parts are its base-two and base-five components wearing base-ten digits. The ten-adic numbers are, in a precise sense, the two-adic numbers and the five-adic numbers side by side, and ee is the switch that selects one of them.

Every base has its own count

The argument for base ten works for any base bb: split bb into its prime powers, put a dial on each, and choose 00 or 11 on each dial.

How many own-square numbers each base has. 2:2 3:2 4:2 5:2 6:4 7:2 8:2 9:2 10:4 11:2 12:4 13:2 14:4 15:4 16:2 17:2 18:4 19:2 20:4 21:4 22:4 23:2 24:4 25:2 26:4 27:2 28:4 29:2 30:8 31:2 32:2 33:4 34:4 35:4 36:4
Fig. 5 The number of solutions of x2=xx^2 = x in each base from 2 to 36. A prime power has two, a base with two prime factors four, and 30, the first base with three, has eight.

The count is 2ω(b)2^{\omega(b)}, where ω(b)\omega(b) is the number of different primes dividing bb. Bases that are powers of a single prime — two, three, four, five, seven, eight, nine — have only 00 and 11, and their adic numbers have no zero divisors. Base six has four, like base ten: 32=93^2 = 9 is written 1313 in base six and ends in 33, and 42=164^2 = 16 is written 2424 and ends in 44. Base thirty has eight, one for each way to choose 00 or 11 on the dials of 22, 33 and 55. The figure checks the count by brute force for every base up to 36.

Base ten is not special in having these numbers; it is special only in being the base people write in, which is why 625625 and 93769376 have been noticed by people who were never told about the Chinese remainder theorem. Numbers whose square ends in themselves are called automorphic numbers in recreational mathematics, and their supply in base ten — exactly two new ones of each length, with occasional exceptions where the new leading digit is a nought — is the dials’ four solutions with the trivial ones removed.

What the digits look like

The two strings are defined by an equation with a two-line solution, and their digits can be computed by the million. What they look like is another matter.

Twenty thousand digits of a number that is its own square. …109376 digit counts 1947,2063,2035,1981,2071,2046,1960,1971,1948,1978; …890625 1978,1948,1971,1959,2046,2072,1981,2035,2063,1947; chi-square 10.575.
Fig. 6 How often each digit occurs among the last 20,000 digits of the two ten-adic numbers that are their own squares. The counts mirror each other, because the two strings add to one, and they look evenly spread.

Because the two strings add up to …0001\ldots 0001, their digits are tied: apart from the last place, a digit of one is nine minus the digit of the other, and the figure checks that across all twenty thousand places. So the two strings have the same statistics, mirrored. Those statistics look like a fair ten-sided die’s: each digit occurs close to two thousand times, and a chi-square test of the counts gives 10.610.6 on nine degrees of freedom, entirely ordinary.

That is the same observation fractions repeat and roots look random made for the digits of 2\sqrt2 and a root lifted one digit at a time made for its seven-adic digits, and it has the same status. Nothing proves that the digits are evenly spread in the long run. The string …109376\ldots 109376 is the two-adic number 00 glued to the five-adic number 11 by the Chinese remainder theorem, and its decimal digits are what that gluing looks like when written in base ten — a mixing of a base-two expansion with a base-five one that nobody has analysed into a proof of normality.

What the dials cannot show

The figures compute everything on dials of up to 102000010^{20000}, in whole-number arithmetic, so each digit shown is exact. What they cannot show is the infinite object. A ten-adic number is the whole consistent family of last digits, and the figures show finitely many members of the family; the claims about the limit — that it is its own square, that the product is nought — are proved by the dial argument at every length, not by any computation.

The convergence they draw also needs a word of interpretation. In ten-adic arithmetic two numbers are close when they share many final digits, not when their difference is small in the ordinary sense: 5285^{2^{8}} and the limit agree in their last ten digits, while 52565^{256} itself is an ordinary number with 179 digits that is nowhere near anything in the ordinary sense. The iterations converge in the sense of the dials, and only in that sense.

Still open: the leading digits

The digits of the two strings are not understood statistically, and one specific question about them has attracted attention. Each new solution of x2=xx^2 = x modulo 10n10^n extends the previous one by one digit, and sometimes that digit is nought, so that the nn-digit solution has fewer than nn significant digits — 06250625 is the four-digit solution, and 625625 was already the three-digit one. How often the new digit is nought, or any given digit, is the same question as the frequency of digits, and the expectation that each digit appears one time in ten, in the long run, in both strings, is supported by every computation and proved by none.

Behind it is a general question about adic numbers defined by simple equations: for which equations, and which bases, are the solutions’ digits normal? For rational solutions the digits eventually repeat, as in base ten; for these irrational ones, as for the seven-adic square root of two, the answer is believed to be “always normal” and is not known for a single case.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

Chinese remainder theoremHensel lemmaLiftingModular arithmeticNewtons methodP adic numbersZero divisor