OFFSET
1,1
COMMENTS
This is a periodic sequence. In fact, a(n) (mod 25) == a(n + k*25) (mod 25), for any k >= 0. The maximum value of a(n) is 21 = lambda(25) + 1 = 20 + 1, since 20 is the Carmichael's lambda value in 25.
REFERENCES
M. Ripà, La strana coda della serie n^n^...^n, Trento, UNI Service, Nov 2011. ISBN 978-88-6178-789-6.
LINKS
J. Jimenez Urroz and J. Luis A. Yebra, On the equation a^x == x (mod b^n), J. Int. Seq. 12 (2009) #09.8.8.
M. Ripà, On the Convergence Speed of Tetration, ResearchGate (2018).
M. Ripà, On the Convergence Speed of Tetration, viXra (2018).
Wikipedia, Charmichael function
Wikipedia, Tetration
Wikipedia, Euler's totient function
FORMULA
For any k >= 0,
a( 1 + k*25) = 2;
a( 2 + k*25) = 21;
a( 3 + k*25) = 21;
a( 4 + k*25) = 11;
a( 5 + k*25) = 2;
a( 6 + k*25) = 6;
a( 7 + k*25) = 5;
a( 8 + k*25) = 21;
a( 9 + k*25) = 11;
a(10 + k*25) = 2;
a(11 + k*25) = 6;
a(12 + k*25) = 21;
a(13 + k*25) = 21;
a(14 + k*25) = 11;
a(15 + k*25) = 2;
a(16 + k*25) = 6;
a(17 + k*25) = 21;
a(18 + k*25) = 5;
a(19 + k*25) = 11;
a(20 + k*25) = 2;
a(21 + k*25) = 6;
a(22 + k*25) = 21;
a(23 + k*25) = 21;
a(24 + k*25) = 3;
a(25*(k + 1))= 2.
EXAMPLE
For n = 41, a(41) = a(16) = 6, since 16^6 mod 25 = 16.
MATHEMATICA
With[{k = 25}, Table[If[Mod[n, 5] == 0, 2, SelectFirst[Range[2, CarmichaelLambda@ k + 1], PowerMod[n, #, k] == Mod[n, k] &]], {n, 75}]] (* Michael De Vlieger, Oct 15 2018 *)
PROG
(PARI) a(n) = {my(m=2); while ((Mod(n, 25)^m != n) && (Mod(n, 25)^m != 0), m++); m; } \\ Michel Marcus, Oct 16 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Marco Ripà, Oct 14 2018
STATUS
approved