%I #6 Mar 30 2024 11:33:26
%S 0,1,-1,7,6,3125,656,43,6,89,0,611,6,53,6,380859375,616,77,-1,79,0,
%T 421,-1,7,76,447265625,203776,3,6,69,0,431,76,13,6,46875,136,17,-1,59,
%U 0,641,-1,7,6,828125,696,3,6,449,0,15051,6,73,6,5234375,456,688057
%N Numbers formed by the rightmost decimal digits of n^n that are the same as those n^(n^n), where -1 indicates that n^n <> n^(n^n) (mod 10).
%C The common digits might include leading 0's (such as at n = 5 or n = 43) and they are discarded (in particular, a(0) = 0 indicates that the corresponding zero digit term results in a 0 integer entry).
%C For n = k*10^c with c >= 1 and k != 0 (mod 10), a(n) = 0 since n^n has (exactly) c*n rightmost 0's.
%C a(n) is equal to -1 if and only if n == 2 or 18 (mod 20).
%H Jorge Jiménez Urroz and José Luis Andrés Yebra, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL12/Yebra/yebra4.html">On the Equation a^x == x (mod b^n)</a>, Journal of Integer Sequences, Article 09.8.8, 2009.
%H Marco Ripà, <a href="https://arxiv.org/abs/2402.07929">Congruence speed of tetration bases ending with 0</a>, arXiv:2402.07929 [math.NT], 2024.
%F If n <> 2,18 (mod 20), then a(n) = A000312(n) (mod 10^k), where k is such that n^n == n^(n^n) (mod 10^k) and n^n <> n^(n^n) (mod 10^(k+1)), whereas a(n) = -1 otherwise.
%e For n = 6, 6^6 = 46656 and 6^(6^6) == 8656 (mod 10^4) so there are three common final digits and a(6) = 656.
%Y Cf. A000312, A317905, A349425, A369624, A369826, A370211, A371048, A371074.
%K sign,base
%O 0,4
%A _Marco Ripà_, Mar 10 2024