Finding the last digit of largest mersenne prime

I was wondering what the best way was to find the last digit of the largest known Mersenne prime $2^{6972593} - 1$? Is there any logical way to do this or will I have to just some how compute the answer and then find the last digit?

-

The answer is yes, there is in fact a "logical" (i.e. simple) way to do this! When computing the last digit of a number, we only need to consider the number mod 10 (that is, we only need to compute its remainder when divided by 10). So let's do that!

We see the powers of $2 \pmod{10}$ cycle nicely:

$2^1 \equiv 2 \pmod{10}$

$2^2 \equiv 4 \pmod{10}$

$2^3 \equiv 8 \pmod{10}$

$2^4 \equiv 6 \pmod{10}$

$2^5 \equiv 2 \pmod{10}$

$2^6 \equiv 4 \pmod{10}$

...etc.

And now the pattern appears obvious. Since the powers of $2$ mod 10 repeat every 4 numbers, we only need to compute $6972593 \pmod 4$. This is simply $1$, and so $2^{6972593} \equiv 2^1 \pmod{10}$ and so it ends in a $2$. Thus, $2^{6972593}-1$ ends in $\boxed{1}$, as desired.

Ask me if you don't understand anything :)

-
Excellently explained. Thanks! –  Jeel Shah Aug 24 '12 at 18:09

All you need to know is the answer modulo $10$. The powers of $2$ mod $10$ have an obvious pattern: $2, 4, 8, 6, 2, 4, 8, 6, ...$ which has a period of $4$, and since $6972593 \equiv 1 (\bmod 4)$, $$2^{6972593} - 1 \equiv 2 - 1 = 1 (\bmod 10).$$

-

$2^4 \equiv 1 \mod 5 \Rightarrow 2^{M4+1} \equiv 2 \mod 5 \,.$

Now, (this is the Chinese Remainder Theorem in a hidden form)

$$2^{6972593} -1\equiv 1 \mod 5 \mbox { and odd} \Rightarrow 2^{6972593} -1\equiv 1 \mod 10 \,.$$

Alternately

$$2^{6972593} -2= 2[(2^4)^m-1]=2 \cdot [(2^4)-1][2^4{m-1}+2^4{m-2}+...+2^4+1]=2 \cdot 5 \cdot 3 \cdot \mbox{junk}$$

Since $2^{6972593} -2$ is divisible by 10, you get the same result.

-