Finding the last digit of $3^{729}$

I'm practicing for my algebra exam but I stumbled on a question I don't know how to solve.

Let $N = 3^{729}$. What is the last digit of $N$?

The example answer says

Since $\gcd(3, 10) = 1$, check that $3^4 = 81 = 1 \pmod {10}$: Now, $729 = 182 \times 4 + 1,$ so we get we get (that might be a typo or missed a step) $3^{729} = 3 \pmod {10}$.

Can anybody help me with this question? Thanks so much!


Solution 1:

Every digit 0 thru 9 has a pattern of 4 digits when raised to an exponential power. Simply divide the power by 4 and the remainder shows you where you are at in the pattern. Here are the patterns for all 10 digits. Note that remainder 1 corresponds to the first digit in the pattern and remainder 2 corresponds to the second digit in the pattern. Remainder 3 corresponds to the third digit and remainder 0 (the power is divisible by 4) corresponds to the fourth digit in the pattern. Try a few yourself using a calculator and you will get the hang of it.

0,0,0,0   
1,1,1,1   
2,4,8,6   
3,9,7,1   
4,6,4,6   
5,5,5,5   
6,6,6,6   
7,9,3,1   
8,4,2,6   
9,1,9,1   

Solution 2:

By Euler's theorem, if $\gcd(a, m) = 1$ then $$ a^{\phi(m)} \equiv 1 \pmod{m} $$ In case $m = 10$ you have $\phi(10) = 4$.

In this case: $\gcd(3, 10) = 1$, so: $$ 3^{729} \equiv 3^{182 \cdot 4 + 1} \equiv (3^4)^{182} \cdot 3^1 \equiv 1 \cdot 3 \equiv 3 \pmod{10} $$ I.e., the result is 3.

Solution 3:

$3^1 \equiv 3(\mod 10)$

$3^{2} \equiv -1 (\mod 10) $

$3^3 \equiv 7 (\mod 10)$

$3^{4} \equiv +1 (\mod 10) \implies 3^{4k} \equiv +1 (\mod 10)$

$3^{4k} \cdot 3 \equiv 3 (\mod 10)$

$3^{4k} \cdot 3^2 \equiv -1 (\mod 10)$

$3^{4k} \cdot 3^3 \equiv 7 (\mod 10)$

$729= 4k+1 \implies 3^{729} \equiv 3 (\mod 10)$

Solution 4:

$3^0\ \ \ \ \ \ \ \ \ \ \ \ \ \ \equiv 1\equiv3^0\mod 10$

$3^1\equiv 3\times 1\equiv 3\equiv3^1\mod 10$

$3^2\equiv 3\times3\equiv 9\equiv3^2\mod 10$

$3^3\equiv 3\times9\equiv 7\equiv3^3\mod 10$

$3^4\equiv 3\times7\equiv 1\equiv3^0\mod 10$

$3^5\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \equiv 3^1\mod 10$

$3^6\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \equiv 3^2\mod 10$

$3^7\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \equiv 3^3\mod 10$

$...$

$3^{728}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \equiv 3^0\mod 10$

$3^{729}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \equiv 3^1\mod 10$