Skip to content
Vamshi Jandhyala

Books · Number Puzzles

Chapter 32

Numbers That Reappear in Their Squares

A three-digit number has this odd habit: the last three digits of its square are the number itself, in the same order. Find it. How many three-digit numbers behave this way?

Solution

There are two: 376376 and 625625, since 3762=141376,6252=390625.376^2 = 141\,376, \qquad 625^2 = 390\,625. To see why these and no others, we want a three-digit nn with n2n^2 ending in nn, that is n2n=n(n1)n^2 - n = n(n-1) divisible by 1000=8×1251000 = 8 \times 125. Now nn and n1n - 1 are consecutive, so they share no common factor; whatever powers of 22 and 55 make up the 10001000 cannot be split between them, so the whole 88 goes into one of the two and the whole 125125 into the other. That gives two interesting cases:

  • 88 divides nn while 125125 divides n1n - 1. So nn is a multiple of 88 that is one more than a multiple of 125125, and the only such number below 10001000 is n=376n = 376 (indeed 376=8×47376 = 8 \times 47 and 375=125×3375 = 125 \times 3).

  • 125125 divides nn while 88 divides n1n - 1. So nn is a multiple of 125125 that is one more than a multiple of 88, which gives n=625n = 625 (since 625=125×5625 = 125 \times 5 and 624=8×78624 = 8 \times 78).

The only other possibilities, where 10001000 divides nn or n1n - 1 outright, give numbers ending in 000000 or 001001, not a genuine three-digit answer. So 376376 and 625625 are the only ones. Such numbers are called automorphic. Pleasingly 376+625=1001376 + 625 = 1001, and the habit persists into more digits: 6252=390625625^2 = 390625 ends in 06250625, and 93762=879093769376^2 = 87909376.