So the other day i asked this question: Repetitive 1-9 pow last digit
Which, well the title speaks for itself, and i got a great answer. However, now i'm onto even deeper problems.
So lets take this one:
$12^{30^{21}}$
12 mod 10 is 2 which gives me period 4. That gives me 30 on mod 4
$30^{1}$mod 4 = 2, $30^{2}$mod 4 = 4, $30^{3}$ = 0, $30^{4}$ = 4, $30^{5}$ = 4, $30^{6}$ = 0 and the rest is also 0...
I then make the assumption that 30 mod 4 gives me period 6
21 mod 6 gives me 3.
Then we got 2^2^3 mod 10 which is 4, when in fact it should be 6. What am i doing wrong here?
Also the power of 30 is quite simple, but what happens when higher numbers occur?
$937640^{767456^{98124}}$ or $937640^{767456^{98124}}$