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 A245972 #24 Jul 25 2022 04:03:06 %S A245972 0,1,2,1,0,5,3,5,2,5,1,5,5,3,5,5,14,11,6,5,17,1,5,5,0,5,2,17,9,5,25, %T A245972 21,23,31,10,29,35,25,5,5,9,17,28,1,20,5,23,5,45,25,14,5,51,29,45,45, %U A245972 44,9,48,5,14,25,38,53,5,23,5,65,5,45,1,29,34,35,50 %N A245972 Tower of 5s mod n. %C A245972 a(n) = (5^(5^(5^(5^(5^ ... ))))) mod n, provided sufficient 5s are in the tower such that adding more doesn't affect the value of a(n). %H A245972 Wayne VanWeerthuizen, <a href="/A245972/b245972.txt">Table of n, a(n) for n = 1..10000</a> %F A245972 a(n) = 5^a(A000010(n)) mod n. For n<=18, a(n)=(5^5) mod n. %e A245972 a(2) = 1, as 5^X is odd for any whole number X. %e A245972 a(19) = 6, as 5^(5^5) == 5^(5^(5^5)) == 5^(5^(5^(5^5))) == 6 (mod 19). %p A245972 A:= proc(n) option remember; 5 &^ A(numtheory:-phi(n)) mod n end proc: %p A245972 A(2):= 1; %p A245972 seq(A(n), n=2..100); %t A245972 a[n_] := a[n] = PowerMod[5, If[n <= 18, 5, a[EulerPhi[n]]], n]; %t A245972 Array[a, 100] (* _Jean-François Alcover_, Jul 25 2022 *) %o A245972 (Sage) %o A245972 def a(n): %o A245972 if ( n <= 18 ): %o A245972 return 3125%n %o A245972 else: %o A245972 return power_mod(5,a(euler_phi(n)),n) %Y A245972 Cf. A000010, A240162, A245970, A245971, A245973, A245974. %K A245972 nonn,easy %O A245972 1,3 %A A245972 _Wayne VanWeerthuizen_, Aug 08 2014