Math CentralQuandaries & Queries


Question from Peter, a student:

Is there a pattern for the 2 rightmost digits of a power? For example, one problem for a math competition was what are the 2 rightmost digits of 3^1993?


There is always a pattern, but it depends on the number. You're asked to evaluate the power (mod 100).

One way uses Euler's Theorem: If a and n are relatively prime, then aphi(n) is congruent to 1 (mod n). Here, phi(n) is the number of positive integers less than n and relatively prime to n. Since phi(100) = 40, we know 340 is congruent to 1 (mod 100). Now 1993 = 49*40 + 33, so 31993 = (340)49x333, which is congruent to 333 (mod 100), etc.

Another way is to keep doubling: 35 == 243 == 43 (mod 100), so 310 == 35 35 == 43 x 43 = 1849 == 49 (mod 100). Similarly 320 == 49 x 49 == 1 (mod 100). Once you've hit 1, life is good. Use the same kind of magic with the exponent as above: 1993 = 99*20+13, so 31993 == 1 x 313 == 310 x 33 == 49 x 27 == 23 (mod 100).

Good luck on similar problems.


Yes, there is. It involves something called Carmichael's lambda function, but individual cases are very easy to explore.

Start by computing the sequence of powers of each one-digit number. Throw away all but the last digit. So for 7 you get:


For 5 you get

5, [2]5, [12]5, [62]5,5,5,5,...

Now try the same thing with some two-digit numbers. Feel free to use a calculator, and throw away all but the last two digits. See a pattern? Try different numbers; there will be some change in the patterns but they will also have certain things in common.

If you want to know the theory behind this try to find a library
that has the College Math Journal and look for my article

Towers of Powers, Modulo m: College Mathematics Journal 25 (1994) 22--28

Good hunting!

About Math Central


Math Central is supported by the University of Regina and The Pacific Institute for the Mathematical Sciences.
Quandaries & Queries page Home page University of Regina PIMS