How many $n$-digit automorphic (circular) numbers are there?

266 Views Asked by At

How many $n$-digit numbers $a$ are there s.t. $a^2$ ends in $a$?

Using Chinese Remainder Theorem it is easy to calculate what these $n$-digit numbers are, $$x\equiv0\ \left(mod\ 2^n\right)\\ x\equiv1\ \left(mod\ 5^n\right),$$ and $$x\equiv1\ \left(mod\ 2^n\right)\\ x\equiv0\ \left(mod\ 5^n\right),$$ we obtain such numbers.

But my question is, how many $n$-digit numbers are there?

So far I have that there is an "upper" limit of $2n$ and a "lower" limit of $n$, but apart from that I don't know derive such a formula to calculate how many there are.

Is there a formula to show how many there are?

Thanks in advance.

1

There are 1 best solutions below

0
On

Automorphic numbers must end in $0,1,5$, or $6$

As indicated by @Arnold D. here, I showed that the only automorphic numbers that end in $0$ or $1$ are $0$ and $1$.

I also showed that the automorphic numbers that end in $5$ or $6$ occur in sequences. The first $6$ are shown below

     5² =           25      11-       5 =      6  and       6² =          36
    25² =          625     101 -     25 =     76  and      76² =        5776
   625² =       390625    1001 -    625 =    376  and     376² =      141376
  0625² =       390625   10001 -   0625 =   9376  and    9376² =    87909376 
 90625² =   8212890625  100001 -  90625 =  09376  and   09376² =    87909376
890625² = 793212890625 1000001 - 890625 = 109376  and  109376² = 11963109376

The table is meant to emphasize that the $(n+1)^{th}$ automorphic number that ends in $5$ can be found by looking at the last $n+1$ digits of the square of the $n^{th}$ automorphic number that ends in $5$.

The $n^{th}$ automorphic number that ends in $6$ is equal to $10^n+1$ minus the value of the $n^{th}$ automorphic number that ends in $5$.

Note that we must cound $0625$ as a four-digit number if we want to count $0625^2 = 390625$ as an automorphic number.

In which case, the answer to your question is $2$.