# Find last digit of $7^{7^{7^7}}$

Find last digit of $7^{7^{7^7}}$

I know that the last digit of $7^x$ depends on the remainder $x$ leaves when divided by $4$: ($x = 7^{7^7}$) $$7^{4k} \equiv 1 \bmod 10$$ $$7^{4k+1} \equiv 7 \bmod 10$$ $$7^{4k+2} \equiv 9 \bmod 10$$ $$7^{4k+3} \equiv 3 \bmod 10$$

And also that

$$7 \equiv -1 \bmod 4$$

So for all odd positive numbers, $7^{n} \equiv -1 \bmod 4$ and $7^{7}$ is odd. But which congruence relation should I use? $4k+3$ and $4k+1$ are both odd

(a)...$7^2\equiv 1$ mod $4\implies$ any odd power of $7$ is congruent to $7$ mod $4 \implies$ any odd power of $7$ is congruent to $3$ mod $4\implies 7^{7^7}\equiv 3$ mod $4$....(b)...$7^4\equiv 1$ mod $10\implies ( 7^n\equiv 7^3\equiv 3$ mod $10$ when $n\equiv 3$ mod $4)$...(c) Therefore $$7^{7^{7^7}}\equiv 3 \text { mod }10.$$

Note that: $7^{7^{7^{7}}}= 7 ^ {7 * 7 *7} \implies 7^{343}$

Let's find a pattern of the last digit:

$7^1 = 7 \implies 7$

$7^2 = 49 \implies 9$

$7^3 = 343 \implies 3$

$7^4 =2401 \implies 1$

Then:

$7^5 = 16807 \implies 7$

$7^6 = 117649 \implies 9$

$\dots$

If we look closer, we will notice the cycle of the last digit $7 , 9, 3, 1$. If the exponent is divisible by $4$, the last digit would be $1$. Let's come up for a solution for $7^{343}$

$$\frac {343} {4} = 85\frac{3} {4}$$

The numerator of the fraction is $3$. Three steps after $1$ will be:

$1$ (doesn't count)

$7$

$9$

$\implies 3$
You're getting yourself confused. $7^7$ is odd, correct; but $7^7$ isn't the exponent you care about. To determine what form to use, the exponent you're looking at is $7^{7^7}$. By your observations, $7^7$ is odd, so $7^{7^7} \equiv -1 \mod 4$. $4n+1$ and $4n+3$ are both odd, yes, but only one of them is $-1\mod 4$: $4n+3$. So $7^{7^7} \equiv 3\mod 4$, and so $7^{7^{7^7}} \equiv 3\mod 10$ according to your table.