Automorphic Numbers in Base 10

Theorem
If leading zeroes are allowed, there are exactly $4$ $n$-digit automorphic numbers in base $10$:
 * $00 \dots 00$
 * $00 \dots 01$
 * $5^{2^{n - 1} } \pmod {10^n}$
 * $6^{5^{n - 1} } \pmod {10^n}$

Proof
The proof proceeds by induction on $n$.

For all $n \in \Z_{> 0}$, let $\map P n$ be the proposition:


 * There are exactly $4$ $n$-digit automorphic numbers of the forms above.

Basis for the Induction
For $n = 1$:

$0, 1, 5, 6$ are the only $1$-digit automorphic numbers, and we have:


 * $5^{2^0} = 5$
 * $6^{5^0} = 6$

Thus $\map P 1$ is seen to hold.

This is the basis for the induction.

Induction Hypothesis
Now it needs to be shown that if $\map P k$ is true, where $k \ge 1$, then it logically follows that $\map P {k + 1}$ is true.

We assume that for some $k \ge 1$, there are exactly $4$ $k$-digit automorphic numbers of the forms above.

Induction Step
This is the induction step:

We aim to construct $x$, a $\paren {k + 1}$-digit automorphic number.

By Left-Truncated Automorphic Number is Automorphic, after removing the leftmost digit, what remains is a $k$-digit automorphic number.

Write $x = 10^k a + b$, where $a$ is the leftmost digit of $x$.

We have:

By Left-Truncated Automorphic Number is Automorphic, $b$ must end in $0, 1, 5, 6$.

We see that:
 * $a \equiv N \pmod {10}$ for $b$ ending in $0$ or $5$;
 * $a \equiv -N \pmod {10}$ for $b$ ending in $1$ or $6$;

So the choice of $x$ is completely determined by $b$.

This shows that there are exactly $4$ $\paren {k + 1}$-digit automorphic numbers.

Now we show that the $4$ numbers are indeed of the forms given above.

For any $n \in \Z_{>0}$, we have:

Since $2^{n - 1} \ge n$ and the each factor on the right is divisible by $2$, the above product is divisible by $5^n 2^n = 10^n$.

Since $5^{n - 1} \ge n$, the above product is divisible by $2^n 5^n = 10^n$.

Hence for each number above:
 * $x^2 \equiv x \pmod {10^n}$

showing they are indeed automorphic.

So $\map P k \implies \map P {k + 1}$ and thus it follows by the Principle of Mathematical Induction that these are all the automorphic numbers.