>>628406Let ^^ be power tower aka iterated exponentiation ie n^^m = n^n^n^...(m time)...^n

https://en.wikipedia.org/wiki/Tetration38^^38 mod 10

= (38 mod 10)^[38^^37] mod 10

= 8^[38^^37] mod 10

There are only so many values 8^n mod 10 can take so list the first few till it repeats

8^1=8

8^2=64=4 mod 10

8^3=8*4=32=2 mod 10

8^4=8*2=16=6 mod 10

8^5=8*6=48=8 mod 10

So 8 has an cycle of length 4 that sweeps 6->8->4->2 for the modulo 4 values of 0,1,2,3 respectively

= 8^[38*38*38^(38^^36-2)] mod 10

= 8^[4*19^2*38^(38^^36-2)] mod 10

= 8^[4*k] mod 10

so 4*k is 0 mod 4 therefore it's the first element of the cycle

= 6