Introduction
Some whole numbers seem to reproduce themselves at the right-hand end of their squares. For example, 25 squared is 625, which ends in 25, and 76 squared is 5,776, which ends in 76. These are not coincidences without a pattern: they satisfy a simple rule about remainders. The rule explains why such numbers exist, how to find more, and why the decimal system matters.
- What Does It Mean for a Square to End in Its Own Number?
- The Simple Arithmetic Behind the Pattern
- Why the Decimal System Produces These Numbers
- How the Main Families Grow
- A Practical Way to Find the Next Digit
- Why Some Familiar Numbers Are Trivial Cases
- Does the Pattern Work in Other Number Bases?
- Why These Numbers Are Useful to Study
- Conclusion
What Does It Mean for a Square to End in Its Own Number?
A number has this property when the final digits of its square match the number itself. The number does not usually equal its square; only its ending must match. For instance, 5 squared is 25, so the square ends in 5. Likewise, 6 squared is 36, which ends in 6.
The examples can have more than one digit. Since 25 squared is 625, the final two digits are 25. Since 76 squared is 5,776, its final two digits are 76. Larger examples include 376 squared, which is 141,376, and 625 squared, which is 390,625.
Numbers with this property are called automorphic numbers in base 10. The name is used for a number whose square ends with the same digits as the number. The important detail is the number of digits: a one-digit number must match the final one digit, while a two-digit number must match the final two.
The Simple Arithmetic Behind the Pattern
To check an automorphic number with n digits, compare its square and the original number only by their final n digits. In arithmetic, comparing final digits is the same as comparing remainders after division by 10n. For a two-digit number, for example, only the remainder after division by 100 matters.
This gives a compact test: a number x with n digits has the property when x2 leaves the same remainder as x when divided by 10n. Equivalently, the difference x2 − x must be divisible by 10n. The symbol “≡” is often used for this kind of equality of remainders, called a congruence.
For 25, the difference between its square and itself is 625 − 25 = 600. That is divisible by 100, so the last two digits of 625 must match 25. For 76, the difference is 5,776 − 76 = 5,700, also divisible by 100. These calculations show that the matching endings follow from divisibility, rather than from a visual trick.
Why the Decimal System Produces These Numbers
Our everyday number system is base 10. A number’s final n digits describe its remainder after division by 10n: the last digit gives the remainder modulo 10, and the last two give the remainder modulo 100. That is why the property is naturally expressed using powers of 10.
There is also a helpful factorization: 10n is made from powers of 2 and 5, because 10 = 2 × 5. The condition x2 ≡ x means x must behave like either 0 or 1 when considered separately modulo those powers. If a number is divisible by the relevant power of 2, for example, its square and itself both have remainder 0 there. If it leaves remainder 1, its square also leaves remainder 1.
For each of the two prime factors, there are two choices: behave like 0 or behave like 1. Combining the choices gives four possible remainder patterns modulo 10n. In practical terms, for each fixed number of digits there are four solutions, including the familiar endings built from 0, 1, 5, and 6. This is why the examples form recurring families instead of appearing at random.
How the Main Families Grow
The most familiar nontrivial examples begin with 5 and 6. Their longer forms include 25, 625, and 0625 on one side, and 76, 376, and 9376 on the other. The leading zero in 0625 is useful when showing that it has four digits for the purpose of checking the last four places; as an ordinary whole number, it is written 625.
Each step extends a valid ending by one digit on the left. For example, 25 is a two-digit solution because 25 squared ends in 25. Extending it to three places gives 625, and 625 squared is 390,625, ending in 625. In the other family, 76 extends to 376, whose square is 141,376 and ends in 376.
At each step there are two possible extensions of a given valid ending, corresponding to the two ways to continue the choices associated with 2 and 5. Across all endings of a given length, the four solutions include the trivial forms ending in all zeros or all ones, as well as the two more striking families. The exact digit strings depend on how many places are being considered.
A Practical Way to Find the Next Digit
The extension rule can be turned into a small calculation. Suppose a number a already works for n digits, and let M = 10n. A candidate with one more digit has the form a + dM, where d is a digit from 0 to 9. The new digit is placed immediately to the left of the existing n-digit ending.
To make this candidate work for n + 1 digits, its square minus itself must be divisible by 10M. Expanding the expression shows that the digit d must satisfy a simple remainder condition modulo 10. Once a valid ending is known, this condition identifies which next digit or digits preserve the property. It is a systematic process, not a matter of guessing and checking every possible large number.
For readers who prefer a direct check, squaring a candidate and inspecting its final digits is often easiest for small examples. The modular method becomes more useful for understanding why the pattern continues and for generating longer examples without writing out every possible square.
Why Some Familiar Numbers Are Trivial Cases
Numbers made entirely of zeros also satisfy the rule: 100 squared is 10,000, ending in 00, and 1,000 squared ends in 000. Numbers made entirely of ones do as well: 11 squared is 121, ending in 11, while 111 squared is 12,321, ending in 111.
These cases are useful because they make the four-solution pattern easier to understand, but they are less surprising than 25 or 76. When people mention automorphic numbers in recreational mathematics, they often emphasize the nontrivial endings that are neither all zero nor all one. The underlying definition, however, includes every number that meets the matching-ending test.
There is a small convention to keep in mind: a number is checked against the same number of final digits as it has digits in its usual written form. Leading zeros are not normally part of an integer’s written form, though they can be shown temporarily when discussing a fixed number of places. This distinction explains why a displayed string such as 0625 represents the same integer as 625 but highlights a four-place pattern.
Does the Pattern Work in Other Number Bases?
Yes. The idea is not exclusive to decimal arithmetic. In a base b, the relevant place values are powers of b, so a number with n digits has the property when its square and itself have the same remainder after division by bn. The decimal examples use powers of 10 because base 10 is the system most readers use every day.
The available patterns can change with the base. The reason is that the arithmetic depends on the prime factors of b. In base 10, those factors are 2 and 5; in another base, different factors may shape the possible remainders. Thus, automorphic behavior is a general idea in place-value arithmetic, while particular examples such as 25 and 76 are specific to decimal notation.
Why These Numbers Are Useful to Study
Automorphic numbers make a good introduction to modular arithmetic because they connect a familiar observation—matching final digits—to a precise mathematical test. Instead of multiplying increasingly large numbers and searching for coincidences, a reader can ask whether x2 − x is divisible by the relevant power of 10.
They also illustrate how place value controls what we mean by “the end” of a number. A one-digit match and a six-digit match are different conditions, each measured against a different power of ten. The same reasoning appears in many elementary questions about last digits, repeating patterns, and remainders.
Most importantly, the examples show that a surprising-looking pattern can have a concise explanation. The square does not somehow remember the whole original number. Rather, the arithmetic of remainders makes certain endings stable when the number is squared.
Conclusion
Some numbers reappear at the end of their squares because their squares have the same remainder as the numbers themselves when divided by the appropriate power of 10. This divisibility condition creates recurring families, including 5, 25, 625, 76, and 376. Known as automorphic numbers, they are a clear example of how place value and remainders can turn an apparent coincidence into a predictable mathematical pattern.

