In mathematics an automorphic number (sometimes referred to as a circular number) is a number whose square "ends" in the same digits as the number itself. For example, 52 = 25, 62 = 36, 762 = 5776, 3762 = 141376,and 8906252 = 793212890625, so 5, 6, 76 and 890625 are all automorphic numbers. The only automorphic Kaprekar number is 1, because the square of a Kaprekar number cannot start with zero.
The sequence of automorphic numbers begins 1, 5, 6, 25, 76, 376, 625, 9376, ... (sequence in the OEIS).
Given a k-digit automorphic number n > 1, an automorphic number n′ with at most 2k-digits can be found with the formula:
For k greater than 1, there are at most two automorphic numbers with k digits, one ending in 5 and one ending in 6. One of them has the form:
and the other has the form:
The sum of the two numbers is 10k + 1. The smaller of these two numbers may be less than 10k − 1; for example with k = 4 the two numbers are 9376 and 625. In this case there is only one k digit automorphic number; the smaller number could only form a k-digit automorphic number if a leading 0 were added to its digits.
The following digit sequence can be used to find the two k-digit automorphic numbers, where k ≤ 1000.
One automorphic number is found by taking the last k digits of this sequence; the second is found by subtracting the first number from 10k + 1.
An n-automorphic number is a number k such that nk2 has its last digit(s) equal to k. For example, since 3*922 = 25,392 and 25,392 ends with 92, so 92 is 3-automorphic.
Automorphic numbers are radix dependent, and the description above applies to automorphic numbers in base 10. Using other radixes there are different automorphic numbers. 0 and 1 are automorphic numbers in every radix; automorphic numbers other than 0 and 1 only exist when the radix has at least two distinct prime factors.