cp's OEIS Frontend

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.

A337398 Steinhaus' Mega, mod n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This sequence is eventually constant: for all n > Mega, a(n) = Mega.

Programs

  • 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

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.