A self-square number

[This is the seventh in a series of posts on the decadic numbers (previous posts: A curiosity, An invitation to a funny number system, What does “close to” mean?, The decadic metric, Infinite decadic numbers, More fun with infinite decadic numbers). I know it’s been a while since I’ve written on this topic, so if you’ve been following along, you might want to go back and refresh your memory.]

Finally, as promised, I can show you the strange number u which is its own square (but which isn’t zero or one!). Up until now all the decadic numbers we’ve considered have been equivalent to familiar rational numbers, but zero and one are the only rational numbers which are their own square; clearly u must be something quite different!

Assuming that such a u could exist—and assuming it’s a decadic integer, that is, has no digits to the right of the decimal point—let’s think for a minute about what u could possibly be. For example, what could its last digit be?

When we multiply two integers, the last digit of the result depends only on the last digits of the integers being multiplied, since all the other digits contribute some power of 10. So we can narrow down the possibilities for the last digit of any self-square decadic integer by seeing which digits have squares that end in the same digit:

d_0 d_0^2
0 0
1 1
2 4
3 9
4 16
5 25
6 36
7 49
8 64
9 81

I’ve highlighted the digits with the desired property: of course, 0^2 = 0 and 1^2 = 1, but also 5^2 ends in 5 and 6^2 ends in 6. We already know we don’t want to consider 0 and 1. So for now, let’s suppose that u ends with 5.

What about the last two digits of u? Again, the last two digits of u^2 depend only on the last two digits of u. (If this isn’t obvious to you, you should try a few examples to convince yourself. For example, what is 1234 \cdot 962? What information did you need to compute the last two digits of the answer?) So whatever the last two digits are, their square, when considered on their own as a two-digit number, must be some number that ends in the same two digits. Assuming the last digit is 5, we can turn this requirement into a modular equation which we can use to solve for the second-to-last digit:

\begin{array}{rcl}(10d_1 + 5)^2 & \equiv & 10d_1 + 5 \pmod{100} \\ 100d_1^2 + 100d_1 + 25 & \equiv & 10d_1 + 5 \pmod{100} \\ 20 & \equiv & 10d _1\pmod{100} \\ 2 & \equiv & d_1 \pmod{10} \end{array}

Sure enough, 25^2 = 625 which ends with 25.

Can we take this further? What about the last three digits?

\begin{array}{rcl}(100d_2 + 25)^2 & \equiv & 100d_2 + 25 \pmod{1000} \\ 10000d_2^2 + 5000d_2 + 625 & \equiv & 100d_2 + 25 \pmod{1000} \\ 600 & \equiv & 100d_2 \pmod{1000} \\ 6 &\equiv & d_2 \pmod{10} \end{array}

Check: 625^2 = 390625, which indeed ends with 625. Continuing in a similar fashion (I’ll let you work out the details on your own), we find that the fourth digit must be 0, and the fifth digit must be 9.

Are you seeing a pattern? Let’s make a table of the results so far:

n u \bmod{10^n} (u \bmod{10^n})^2
1 5 25
2 25 625
3 625 390625
4 0625 390625
5 90625 8212890625

Why did I put some numbers in bold? Well, hopefully you’ve noticed by now that each number in the left-hand column always seems to be a suffix of the square of the previous number. So perhaps the next digit will be 8? Sure enough, 890625^2 ends in 890625.

Will this always work? Yes, in fact, it will, and here’s why. Let’s let u_n denote the last n digits of u (so u_1 = 5, u_2 = 25, and so on). Once we have found u_n, we can set up a modular equation to find the next digit (this is just a generalization of what we did earlier):

\begin{array}{rcl}(10^n d_n + u_n)^2 & \equiv & 10^n d_n + u_n \pmod{10^{n+1}} \\  10^{2n} d_n^2 + 2 \cdot 10^n d_n u_n + u_n^2 & \equiv & 10^n d_n + u_n \pmod{10^{n+1}} \end{array}

Now, 10^{2n} d_n^2 is clearly divisible by 10^{n+1} so that term goes away. But what about 2 \cdot 10^n d_n u_n? It seems that we only know it is divisible by 10^n, not necessarily by 10^{n+1}. Ah, but wait! We know that u_n ends with 5, and hence is divisible by 5; combining this with the 2 gives us another factor of 10! So this term goes away too, and we are left with

u_n^2 \equiv 10^n d_n + u_n \pmod{10^{n+1}}.

Now, u_n^2 \equiv u_n \pmod{10^n} (by definition), so subtracting u_n from both sides leaves a multiple of 10^n in the place of u_n^2 (namely, u_n^2 with the rightmost n digits set to zero). But we can also get rid of all the digits to the left of the (n+1)st because we are working mod 10^{n+1}. Dividing by 10^n we find that d_n must be equal to that (n+1)st digit of u_n^2.

So here’s the procedure: starting with u_1 = 5, define

u_{n+1} = u_n^2 \bmod{10^{n+1}}

That is, square the current number of length n and take the last n+1 digits to get the next number. The above proof shows that

  • At every step we will have a number u_n whose square ends with the digits of u_n;
  • this procedure will always work; and
  • this procedure gives the unique sequence of u_n with this property when starting with u_1 = 5!

So we have

\begin{array}{rcl} u_1 & = & 5 \\ u_2 & = & 25 \\ u_3 & = & 625 \end{array}

and so on.

So what is u? It is simply the limit of carrying out this procedure to infinity!

u = \dots 57423423230896109004106619977392256259918212890625

We know that any suffix of u, when squared, yields something ending with itself. So it makes sense (although it takes a bit of imagination!) that squaring u itself yields u again.

About Brent

Associate Professor of Computer Science at Hendrix College. Functional programmer, mathematician, teacher, pianist, follower of Jesus.
This entry was posted in arithmetic, infinity, iteration, modular arithmetic, proof and tagged , , , . Bookmark the permalink.

12 Responses to A self-square number

  1. Harley says:

    Very cool. Great post.

  2. Jonathan says:

    Still enjoying.

  3. I don’t think $u$ exists, in that the series you define doesn’t converge, so in the limit you have an infinite digital expansion which does not correspond to any Natural. I think you’ve actually shown that 0 and 1 are the only solutions.

    • Brent says:

      Sorry, I didn’t make this part very clear. As explained in some previous posts in the series, we’re working not with natural numbers but with decadic numbers (i.e. p-adic numbers for p = 10), which have a funny metric under which the sequence of u_n does, in fact, converge.

      • $\emph{reads earlier posts \ldots}$

        More questions!

        Does your notion of infinite decadic numbers require the digital expansion to have a regular form? Judging from the definition of $$u$$ above, I’m guessing not.

        Does every infinite digital expansion correspond to an infinite decadic number?

        Is there a correspondence between infinite decadic numbers and negative integers? Isomorphism?

  4. And which negative integer does u correspond to?

  5. Brent says:

    Does your notion of infinite decadic numbers require the digital expansion to have a regular form?

    No. Any infinite sequence of digits is defined as the limit of the sequence of its suffixes. (Which always exists, thus answering your second question as well.) Of course, you could make a distinction between computable and non-computable infinite decadic numbers, but that distinction is not inherent in the definition.

    Is there a correspondence between infinite decadic numbers and negative integers? Isomorphism?

    As explained here, every negative rational with a denominator relatively prime to 10 (including all the negative integers) corresponds to an infinite decadic number. However, the reverse is false: most infinite decadic numbers do not correspond to any rational (since the rationals are countable and the infinite decadic numbers have the same cardinality as the reals).

    u does not correspond to any rational number, since it is its own square yet not equal to zero or one.

  6. Okay, now it makes sense to me! I had been interpreting things much more narrowly.

  7. Steve says:

    There’s another one ending in 6.

    The solutions of u^2=u are 0 and 1. We have to consider these modulo powers of 2 and powers of 5, and then combine them to get decadic solutions. If the solution is 0 mod 2^n and 0 mod 5^n for all n, then the only combined solution is 0 mod 10^n. Similarly, 1 mod 2^n and 1 mod 5^n constrains us to get 1 mod 10^n. The decadic integers …0000000 and …0000001 are self-squares. But suppose we find a solution that is simultaneously 0 mod 2^n and 1 mod 5^n? Or vice versa? That gives us another two solutions, satisfying the self-square relation for each prime factor separately, and hence in combination.

    So if a quadratic with integer roots has two conventional solutions and two mixed solutions in the decadic numbers, would a cubic equation with distinct integer roots have three conventional solutions and six mixed ones? If you looked at numbers in base 30 (triakontadic?), would you get additional mixtures, because it has three prime factors?

    It would make an interesting starting point for an investigation.

    • Brent says:

      Yes, the one ending in 6 is 1 - u, but it doesn’t have the nice property that u has where you can just square u_n and read off the next digit. Re: the other stuff, interesting questions! I don’t know the answers. I agree it would make an interesting starting point for an investigation.

  8. Pingback: Mathblogging.org Weekly Picks « Mathblogging.org — the Blog

  9. Pingback: Computing with decadic numbers | The Math Less Traveled

Comments are closed.