16

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!

pjs36
  • 17,979
Michael
  • 397

6 Answers6

18

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   
  • So for other questions similar to that would I start with gcd(x, 10) or do I just have to find a number such that the gcd is 1? Also what is the base number was larger than 3 would it still work? – Michael Apr 22 '13 at 06:00
  • To find the last digit, typically, you will find that $a^n$ repeats with a cycle of length of maximum $4$. –  Apr 22 '13 at 06:03
  • Sorry, I don't quite understand what you mean by a cycle of length of maximum 4. – Michael Apr 22 '13 at 06:08
  • @Michael For instance, we have $2^1$ ends in $2$, $2^2$ ends in $4$, $2^3$ ends in $8$, $2^4$ ends in $6$, $2^5$ ends in $2$, $2^6$ ends in $4$, $2^7$ ends in $8$, $2^8$ ends in $6$, and so on. So if you see, you will find that the last digit repeats in a cyclic fashion, i.e., $2,4,8,6,2,4,8,6,2,4,8,6,\ldots$. You will find a similar pattern for all the other numbers as well. –  Apr 22 '13 at 06:10
  • Thanks so much and one last question. How do know which m to use for (mod m) in questions like this. – Michael Apr 22 '13 at 06:14
  • @Michael When you are asked for the last digit, you need to go $\pmod{10}$, and similarly, if you are asked for last two digits, you need to go $\pmod{100}$ and in general, if you are asked for last $n$ digits, we need to go for $\pmod{10^n}$. –  Apr 22 '13 at 06:16
  • Is it not a coincidence that it takes at most $5 = \phi(10) + 1$ powers in order to get back to the original digit? For example, base $N$, would it take at most $\phi(N) + 1$ powers to get back to the original digit? – Doug Sep 09 '14 at 01:03
13

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.

vonbrand
  • 27,812
2

$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)$

Inceptio
  • 7,881
1

I have easy and simple approach for this Question.

Power of 3 Last digit

$3^1: 3$

$3^2: 9$

$3^3: 7$

$3^4: 1$

$3^5: 3$

$3^6: 9$

$3^7: 7$

$3^8: 1$

From the above demonstration we can see some similarity which is last digit for $3$ is repeating continuously $(3,9,7,1)$.

Wee can see that $279\cong 1 \mod 4$ From the last digit of the $3^1 = 3$. So last digit of $3^279 = 3$. Pretty simple huh.

Kevin Long
  • 5,159
1

$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$

-2

Last Digit of $N = 3^{729}$ is equal to last digit of $3^9 = 3$

juantheron
  • 53,015