Introduction

You have have noticed that if you multiply two numbers that both end in zero together, the result will also end in zero (in fact, it will end in two zeros), e.g. $2\textcolor{#ff00af}{0} \times 3\textcolor{#ff00af}{0} = 60\textcolor{#ff00af}{0}$.

You may have also noticed that if you multiply two numbers that both end in five together, the result will also end in five, e.g. $2\textcolor{#ff00af}{5} \times 3\textcolor{#ff00af}{5} = 87\textcolor{#ff00af}{5}$.

Perhaps slightly less obviously, if you multiply two numbers that both end in one together, the result will also end in one, e.g. $2\textcolor{#ff00af}{1} \times 3\textcolor{#ff00af}{1} = 65\textcolor{#ff00af}{1}$.

And even less obviously, if you multiply two numbers that both end in six together, the result will also end in six, e.g. $2\textcolor{#ff00af}{6} \times 3\textcolor{#ff00af}{6} = 93\textcolor{#ff00af}{6}$.

This property is what makes $0$, $1$, $5$, and $6$ automorphic (which literally means having the same shape as itself).

Longer numbers

There are four one-digit automorphic numbers. It turns out, for any number of digits there will be four automorphic numbers, two of which are trivial.

Trivial automorphic numbers

The two trivial two-digit automorphic numbers are $00$ and $01$. Arguably, neither of these is a number, but you get the idea.

$\begin{aligned} 3\textcolor{#ff00af}{01} \times 4\textcolor{#ff00af}{00} = 120,0\textcolor{#ff00af}{01} \\ 3\textcolor{#ff00af}{01} \times 4\textcolor{#ff00af}{01} = 120,7\textcolor{#ff00af}{01} \\ \end{aligned}$

For every $n$, there are two trivial $n$-digit automorphic "numbers", which are $n$ zeros and $n - 1$ zeros followed by a one.

Non-trivial automorphic numbers

The two non-trivial two-digit automorphic numbers are $25$ and $76$.

$\begin{aligned} 3\textcolor{#ff00af}{25} \times 4\textcolor{#ff00af}{25} = 138,1\textcolor{#ff00af}{25} \\ 3\textcolor{#ff00af}{76} \times 4\textcolor{#ff00af}{76} = 178,9\textcolor{#ff00af}{76} \\ \end{aligned}$

As you might have predicted, each two digit automorphic number must end in a one digit automorphic number. To find the three digit automorphic numbers, we can start with (or end with) $25$ and $76$. They are $625$ and $376$.

Why are automorphic numbers

Some questions around automorphic numbers:

  • What makes automorphic numbers automorphic?
  • Why are there four for a given number of digits?
  • Do they have any other properties

One way to look at it, is that in order for a number ending in $25$ multiplied by a number ending in $25$ to equal a number ending in $25$, a number ending in $25$ multiplied by a number ending in $24$ must equal a number ending in $00$.

In other words, an $n$-digit automorphic number multiplied by itself minus 1 must be divisible by $10^n$.

$\begin{aligned} 5 \times 4 &= 20 \\ 6 \times 5 &= 30 \\ 25 \times 24 &= 600 \\ 76 \times 75 &= 5,700 \\ 625 \times 624 &= 390,000 \\ 376 \times 375 &= 141,000 \\ \end{aligned}$

Concluding remarks

As far as I know there are no practical uses to automorphic numbers (though it's maybe useful to know that multiplying two numbers ending in five or six together will result in a number ending with the same).

Whilst at university, I spent way too long trying to generate automorphic numbers in an Excel spreadsheet, one digit at a time, going down the page. Since the Excel was unable to multiply, or even display in a single cell, such large numbers (around 100 digits) I had to implement my own multiplication logic. Despite the fact that multiplication is relatively simple, I found having to implement your algorithm forced me to understand it a lot more deeply than I had.