%I #13 Aug 29 2020 16:49:25
%S 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,
%T 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,
%U 25,16,20,16,12,8,4,0,61,58,33,52,13,46,12,40,32,44
%N Steinhaus' Mega, mod n.
%C This sequence is eventually constant: for all n > Mega, a(n) = Mega.
%H Katie Steckles, <a href="https://www.youtube.com/watch?v=YrSSwKlINFM">Katie's #MegaFavNumbers - the MEGISTON, and Steinhaus-Moser notation</a>, video (2020)
%H Hugo Steinhaus, <a href="https://archive.org/details/mathematicalsnap0000unse">Mathematical Snapshots</a>, 2nd ed., New York: Oxford University Press, 1951, p. 19. [These numbers are not mentioned in the first (1938) edition.]
%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Mega.html">Mega</a>.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Steinhaus%E2%80%93Moser_notation">Steinhaus-Moser notation</a>.
%H <a href="/index/Rec#order_01">Index entries for linear recurrences with constant coefficients</a>, signature (1).
%F 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.
%o (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
%K nonn
%O 1,6
%A _Charles R Greathouse IV_, Aug 26 2020