Problem:
The positive integers N and N2 both end in the same sequence of four digits abcd when written in base 10, where digit a is not zero. Find the three-digit number abc.
Solution:
Write N=10000M+k, where M is an integer, and 1000β€kβ€9999. Then because N2 and N end in the same four digits,
N2βN=(104M+k)2β(104M+k)=104(104M2+2MkβM)+(k2βk)
ends in four zeroes. Thus 10000=24β
54 divides k2βk=k(kβ1). Because k and kβ1 are relatively prime, there are four possibilities.
-
104β£k so k=0,
-
104β£(kβ1) so k=1,
-
54β£k and 24β£(kβ1) so k=625, and
-
24β£k and 54β£(kβ1) so kβ1 must be 625m for a positive integer m where 16 divides 625m+1. Because 625β‘1(mod16),15β
625β‘15(mod16) and 16 divides 15β
625+1=9376 implying that k=9376.
The first three cases are not possible if kβ₯1000, but k=9376 does work. The requested three digit number is 937β.
Note that for any positive integer r, if the positive integers N and N2 end in the same r digits, there are always exactly 4 possible sequences of r final digits.
The problems on this page are the property of the MAA's American Mathematics Competitions