Last digits of n^(n-1)^(n-2)^(n-3) and so on.

111 Views Asked by At

If given $n$, how would I get the last digits of $n^{{n-1}^{{n-2}^{\dots}}}$, for example $$5^{\displaystyle4^{3^2}}.$$

As far as I've gotten is that the last digits tend to repeat after a while, but I don't know where to go from there.

For $6$ the last two repeating digits ($n^i \pmod{100}$) are $$36\ 16\ 96\ 76\ 56.$$

1

There are 1 best solutions below

4
On BEST ANSWER

The repetition is after the 4th power,i.e.,

Last digit of $n^k$ = Last digit of $n^{k+4}$ = Last digit of $n^{k+8}$ and so on...

You can express $n^{(n-1)^{(n-2)...}}$ as $n^{4k+m} \forall k \in $Whole Numbers , $m\in \{0,1,2,3\}$

For e.g. if you have $n = 5$, you get $5^{4^{3}...}$ which is $5^{4^{integer}}$ which can be written as $5^{4*integer} = 5^{4*integer}$ and that integer is = $k$ thus $m$ being zero.

Here $k$ is not of use but $m$ is.

Here's the link for reference of $n$ and $m$: http://www.iiti.tk/tab.html

The value's under m give the value of last digit.

For instance taking $n=12$, we get the exponential part as $11^{10^{9^{8^{7...}}}}$ which is either $4k+3$ or $4k+1$ (being odd). Next, utilising Remainder theorem, we deduce that it is $4k+1$ for even powers of 11 and $4k+3$ for odd powers of 11. Since the power of 11 is even ($10^{integer}$ is even), thus it is of the form $4k+1$.

So we get n=12 and last digit of n is 2 and $m = 1$, we get the last digit of the expression as 2.