



 
Hi Jay, I can help somewhat. I want to consider the case of the last two digits but you can extend this to more than two. Any positive integer $a$ can be written $a = 100 \times s + t,$ for example $67547 = 675 \times 100 + 47 = 67500 + 47.$ Thus \[a^2 = \left(100 \times s + t\right)^2 = \left(100 \times s\right)^2 + 2 \times 100 \times s \times t + t^{2}.\] Hence \[a^2 = u \times 100 + t^2 \mbox{ for some positive integer u.}\]
Thus the last two digits of $a^2 = \left(100 \times s + t\right)^2$ are the same as the last two digits of $t^{2}.$ Using the Binomial Theorem you can see that the last two digits of $a^n = \left(100 \times s + t\right)^n$ are the same as the last two digits of $t^{n}$ for any positive integer $n.$ I hope this helps, Jay wrote back
Actually it's not as bad as it seems. If you are looking at the last two digits of $a^n$ there are only 100 possibilities, 00, 01, 02 and so on up to 99. Hence if you know $a,$ and $t$ is its last two digits there are only 100 possibilities for the last two digits of $t^{n}.$ I used Excel to do the arithmetic in an example. Suppose that the last two digits in $a$ are 14. The image below is the first 18 rows of an Excl file where the $n^{th}$ row is the last two digits of $14^{n}.$ You can see that the entries in rows 2 and 12 are the same and then the entries repeat. Hence the last two digits on $14^n$ can only be 14, 96, 44, 16, 24, 36, 04, 56, 84, 76 or 64. If the last two digits of $N$ is not in this list then you are out of luck. If it does appear in row $n$ then this is the smallest integer $n$ so that the last two digits of $a^n$ are the last two digits of $N.$ I have attached the Excl file I used so that you can modify it for your use. Harley 



Math Central is supported by the University of Regina and The Pacific Institute for the Mathematical Sciences. 