This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A332054 #6 Mar 04 2020 07:37:58 %S A332054 0,1,0,1,4,3,1,1,0,9,5,9,1,1,9,9,9,9,1,9,15,5,8,9,14,1,0,1,9,9,4,9,27, %T A332054 9,29,9,1,1,27,9,9,15,11,5,9,31,32,9,15,39,9,1,9,27,49,1,39,9,57,9,34, %U A332054 35,36,9,14,27,22,9,54,29,12,9,72,1,39,1,71,27 %N A332054 Tower of 9's modulo n. %C A332054 a(n) = (9^(9^(9^(9^ ... )))) mod n, provided sufficient 9's are in the tower such that adding more doesn't affect the value of a(n). %F A332054 a(n) = 9^a(A000010(n)) mod n. %F A332054 a(n) = (9^^k) mod n, if n < A246497(k), where ^^ is Knuth's double-arrow notation. %o A332054 (PARI) a(n) = {my(b, c=0, d=n, k=1, x=1); while(k==1, z=x; y=1; b=1; while(z>0, while(y<z, d=eulerphi(d); y++); b=9^b-floor((9^b-1)/d)*d; z=z-1; y=1; d=n); if(c==b, k=0); c=b; x++); b%n; } %Y A332054 Cf. A240162, A245970, A245971, A245972, A245973, A245974, A246497, A332055. %K A332054 nonn %O A332054 1,5 %A A332054 _Jinyuan Wang_, Mar 03 2020