# Last digit of $3^{459}$. [duplicate]

I am supposed to find the last digit of the number $3^{459}$. Wolfram|Alpha gives me $9969099171305981944912884263593843734515811805621702621829350243852275145577745\\3002132202129141323227530694911974823395497057366360402382950449104721755086093\\572099218479513977932448616356300654729978057481366551670706\color{red}{\mathbf{7}}$

Surely there's some sort of numerical trick to doing this. I thought maybe modular arithmetic was involved? Any ideas on how to approach this problem?

• Hint: mod $10\!:\ 3^2\equiv -1\,\Rightarrow\,\color{#c00}{3^4\equiv 1}\,\Rightarrow\, 3^{\large\rm 3+4N}\equiv 3^{\large 3} (\color{#c00}{3^{\large 4}})^{\large\rm N}\equiv 7 \color{#c00}{(1)}^{\large\rm N}\equiv 7\$ by Congruence Rules Feb 14 '15 at 2:37
• @mysticflower, See math.stackexchange.com/questions/757894/… Feb 14 '15 at 3:13

## 2 Answers

Try out the first few powers of $3$: we have that $$3^1=3, 3^2=9, 3^3=27, 3^4=81, 3^5=243, 3^6=729,\ldots$$ It seems like the final digit cycles in a pattern, namely $$3\to9\to7\to1\to3\to9\to7\to1,$$ of length $4$. Since $$459=4\cdot114+3,$$ the final digit is the third in the cycle, namely $\color{red}{\mathbf{7}}$, and, sure enough, your Wolfram|Alpha computation confirms this.

$$3^{4}=1\pmod{10}\implies (3^{4})^{114}=1 \pmod{10}$$ So $$3^{459}=3^{4 \times 114}\cdot 3^{3}=3^{3}\pmod{10}=7\pmod {10}$$