# Last digits, numbers

1) Find the last digit of $7^{12345}$

2) Find the last 2 digits of $3^{3^{2014}}$.

Attempt: 1)

By just setting the powers of $7$ we have $7^1 = 7$, $7^2=49$, $7^3=343$, $7^4 = 2401$, $7^5 = 16807$, $7^6 = 117649$, $\dots$ After the power of $4$, the last digits will repeat. Then by noticing the pattern the digits will end in $7,9,3$ and $1$.

Then we can divide the exponent $(12345)$ by $4$ since this is the cycle that makes it repeat. Then $12345 : 4$ has remainder $1$. So $7^1 = 7$ is the unit digit to $7^{12345}$.

So the last digit is $7$.

I know how to do it like this, the problem does not state how to find the last digit, but I know it has something do do with Euler's theorem.

for part $2$) I don't know how to start. Can anyone please help me?

Thank you for the help.

• you just need to find last digits in 1st part not the whole powers of 7. Apr 23, 2014 at 5:49
• That was an example to notice the pattern. I am trying to find the last digit. Apr 23, 2014 at 5:51
• maybe binomial theorem will help. writing 3^2 as 10-1. Apr 23, 2014 at 5:52
• You can do part B similarly to how you did part A. 3^21 mod 100 = 3^1 mod 100. This means the pattern repeats every 20 terms, so 3^2014 mod 100 = 3^14 mod 100 = 69. So you have 3^69 mod 100 = 3^9 mod 100 = 83 Apr 23, 2014 at 6:06

First of all, finding last $n$ digits in Base $10$ essentially finding modulo $\displaystyle10^n$

Using Carmichael function, $\displaystyle3^{\lambda(100)}\equiv1\pmod{100}$ as $(3,100)=1$

$$\implies3^{3^{2014}}\equiv3^{3^{2014}\pmod{\lambda(100)}}\pmod{100}$$

Now $\displaystyle\lambda(100)=20,$ so we need to find $\displaystyle3^{2014}\pmod{20}$

and by observation $\displaystyle3^4=81\equiv1\pmod{20}$ or using Carmichael function $\displaystyle\lambda(20)=4\implies3^4\equiv1\pmod{20}$

and as $\displaystyle2014\equiv2\pmod4\implies3^{2014}\equiv3^2\pmod{20}\equiv9$

$$\implies3^{3^{2014}}\equiv3^9\pmod{100}$$

Now $\displaystyle3^9=3\cdot3^8=3\cdot(3^2)^4=3(10-1)^4=3(1-10)^4=3\left[1-\binom4110+\binom4210^2-\binom4310^3+10^4\right]$

$\displaystyle\equiv3\left(1-40\right)\pmod{100}\equiv-117\equiv83$

Let $$3^{2014}-1=2x$$

Your number is : $3^{2x+1}=3\cdot3^{2x}=3(10-1)^{x}=3(-1+10)^{x}$

Using binomial theorem and neglecting powers of $10$ greater than $2$ as we want only last $2$ digits.

$$3(-1^{x}+x(-1)^{x-1}10)$$

Writing $3$ as $4-1$ in first expression will lead you to believe that $2x$ is divisible by $4$. Hence, $x$ is even.

$$3(1-10x)=3(1-5\cdot2x)$$

I hope you can carry on from here. You will need last two digits of $3^{2014}$ which you can find by writing it as $(10-1)^{1007}$