OFFSET
1,3
COMMENTS
Unlike the analogous sequence based on A000005, the non-powers 2 which emerge during iteration are initial, consecutive iterates, except the last one=0.
EXAMPLE
n=9, initial value=9!=362880, the successive iterates when the cototient function (A051953) is repeatedly applied are: {362880, 279936, 186624, 124416, 82944, 55296, 36864, 24576, 16384, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0}. This includes 8 initial and 1 terminal (it is the 0) which are not powers of 2. So a(9)=8+1=9. Beside 15 2-powers appear.
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; }
A053036(x) = {local(li, fa, count); 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)) || (matsize(fa)[1] == 0), 0, count++)); count}
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Feb 24 2000
EXTENSIONS
More terms from Olaf Voß, Feb 20 2008
STATUS
approved