OFFSET
1,3
COMMENTS
If the exponent is a(n), then the number of powers of 2 in the iteration-chain is 1+a(n), the maximal 2-power is 2^a(n) and the number of iterations (until fixed state) performed on these 2-powers is a(n).
EXAMPLE
For n = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 and starting the iteration of A051593 with n!, the first powers of 2 which appear are 1, 2, 4, 16, 32, 128, 512, 4096, 16384, 2048 and the corresponding exponents are a(n) = 0, 1, 2, 4, 5, 7, 9, 12, 14, 11.
MATHEMATICA
Log2 /@ Table[NestWhile[# - EulerPhi@ # &, n!, ! IntegerQ@ Log2@ # &], {n, 60}] (* Michael De Vlieger, Aug 15 2017 *)
PROG
(PARI) cototient(x)= x - eulerphi(x)
FunctionIterate(f, x, t)= {local(retval); retval = vector(0); while(x!=t, x = eval(concat(f, "(x)")); retval = concat(retval, x)); retval; }
A053039(x) = {local(li, fa, retval); count = 0; li = concat([x! ], FunctionIterate("cototient", x!, 0)); for(i=1, #li, fa = factor(li[i]); if(((matsize(fa)[1] == 1) && (fa[1, 1] == 2)), retval = fa[1, 2]; break)); retval}
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Feb 24 2000
EXTENSIONS
More terms from Olaf Voß, Feb 21 2008
STATUS
approved