A number and its square both have the same last three digits. What are the possibilities for those digits?
Having the same last three digits is generally equivalent to saying that the number and its square are equal mod 1000. (It also might imply that the number itself has three digits but that's a detail.)
if x^2 = x mod 1000 then x(x-1) = 1000k for some k. Now, both x and x-1 can't be even, so only one of these can contribute the factor of 2^3 needed to be a multiple of 1000. A similar argument applies for the factor of 5^3 (1000=2^3*5^3). The solutions, therefore, come from deciding which factor, (x) or (x-1) has contributes 2^3 and which contributes 5^3. There are at most four distinct solutions (mod 1000) then, since there are four combinations.
(1) both come from (x). Then x=1000 mod 1000 and "000" are the common final three digits. (x=0 is a solution according to whether you admit solutions of fewer than three digits or not)
(2) both come from (x-1). Then x-1=1000 mod 1000 and x=1001 mod 1000 and "001" are the common final three digits. (x=1 is a solution if you thought x=0 was a solution)
(3) 2^3 comes from (x) and 5^3 comes from (x-1). Then x = 8k and 8k-1=125m for some k and m. Using the chinese remainder theorem and some inspection yields k=47,m=3 as the solution and x=8*47+1=376 mod 1000 is a solution
(4) 2^3 comes from (x-1) and 5^3 comes from (x). Similar logic to (3) gives x=625 mod 1000 as the solution here.
So the solution is: x=1000, 1001, 376, 625 mod 1000, possibly excepting x=0 and x=1 as having too few digits.
This solution only covers the case of positive numbers, however. There are also solutions involving negative values of x. x= 1000 applies in either case. For x<0 a similar argument to the above yields x=-1, -376, and -625 mod 1000.
The complete solution then is:
x = 1000y (y != 0 if three digit minimum required)
x = 1 + 1000y (y >= 0 or y > 0 if three digit minimum)
x = 376 +1000y (y>=0)
x = 625 + 1000y (y >=0)
x = -1 -1000y (y >= 0 or y > 0 if three digit minimum)
x = -376 -1000y (y>=0)
x= -625 -1000y (y>=0)
If rational solutions are permitted where the "last three digits" are the three rightmost digits and not necessarily the same position relative to the decimal point, then any of the above solutions is still a solution if divided by any positive power of 10. However, no other solutions would be added by this method, since we could always multiply such a solution by a sufficiently large power of 10 to extract an integer solution, which would necessarily be one of the previously listed one. And of course, no irrational solutions exist since there are no "last three digits" for such numbers.
|
Posted by Paul
on 2007-08-28 19:41:59 |