OFFSET
1,4
COMMENTS
Also, limit of f(f(f(...f(m))...) modulo n for any integer m >= 2.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
FORMULA
MATHEMATICA
Clear[a]; Unprotect[Power]; 0^0 = 1; a[1]=0; a[n_] := a[n] = Module[{g, m = n}, g = 2^IntegerExponent[m, 2]; m = Floor[m/g]; Mod[ ChineseRemainder[ {0, Mod[2, m]^a[EulerPhi[m]]}, {g, m}] - 1, n]]; Array[a, 100] (* Jean-François Alcover, Jan 01 2016, adapted from PARI *)
PROG
CROSSREFS
KEYWORD
AUTHOR
Max Alekseyev, Jan 30 2015
STATUS
approved