

A245972


Tower of 5s mod n.


9



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, 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, 44, 9, 48, 5, 14, 25, 38, 53, 5, 23, 5, 65, 5, 45, 1, 29, 34, 35, 50
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,3


COMMENTS

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).


LINKS

Wayne VanWeerthuizen, Table of n, a(n) for n = 1..10000


FORMULA

a(n) = 5^a(A000010(n)) mod n. For n<=18, a(n)=(5^5) mod n.


EXAMPLE

a(2) = 1, as 5^X is odd for any whole number X.
a(19) = 6, as 5^(5^5) == 5^(5^(5^5)) == 5^(5^(5^(5^5))) == 6 (mod 19).


MAPLE

A:= proc(n) option remember; 5 &^ A(numtheory:phi(n)) mod n end proc:
A(2):= 1;
seq(A(n), n=2..100);


PROG

(Sage)
def a(n):
if ( n <= 18 ):
return 3125%n
else:
return power_mod(5, a(euler_phi(n)), n)


CROSSREFS

Cf. A240162, A245970, A245971, A245973, A245974.
Sequence in context: A327358 A256664 A226783 * A088391 A128899 A155887
Adjacent sequences: A245969 A245970 A245971 * A245973 A245974 A245975


KEYWORD

nonn,easy


AUTHOR

Wayne VanWeerthuizen, Aug 08 2014


STATUS

approved



