login
A337398
Steinhaus' Mega, mod n.
0
0, 0, 1, 0, 1, 4, 4, 0, 4, 6, 3, 4, 9, 4, 1, 0, 1, 4, 6, 16, 4, 14, 3, 16, 6, 22, 22, 4, 16, 16, 8, 0, 25, 18, 11, 4, 7, 6, 22, 16, 10, 4, 16, 36, 31, 26, 25, 16, 39, 6, 1, 48, 24, 22, 36, 32, 25, 16, 20, 16, 12, 8, 4, 0, 61, 58, 33, 52, 13, 46, 12, 40, 32, 44
OFFSET
1,6
COMMENTS
This sequence is eventually constant: for all n > Mega, a(n) = Mega.
LINKS
Hugo Steinhaus, Mathematical Snapshots, 2nd ed., New York: Oxford University Press, 1951, p. 19. [These numbers are not mentioned in the first (1938) edition.]
Eric Weisstein's World of Mathematics, Mega.
FORMULA
a(n) = (2 in a circle) mod n = (256 in a square) mod n = (...((256 in a triangle) in a triangle)... in a triangle) mod n [with 256 triangles], where k in a triangle = k^k, k in a square = k in k triangles, and k in a circle = k in k squares.
PROG
(PARI) a(n)=my(m=lcm(eulerphi(n), n), t=Mod(256, m), e, last=t); for(i=1, 256, e=lift(t); t=t^(e+m); if(t==last, return(e%n)); last=t); lift(t)%n
CROSSREFS
Sequence in context: A138518 A290799 A155836 * A245971 A279365 A164613
KEYWORD
nonn
AUTHOR
STATUS
approved