OFFSET
1,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
If n = 164, the "iterated phi-sequence" for n is {164,80,32,16,8,4,2,1}. It includes 6 powers of 2 at the end, so a(164) = 6.
MAPLE
A049113 := proc(n)
local a, e;
e := n ;
a :=0 ;
while e > 1 do
if isA000079(e) then
a := a+1 ;
end if;
e := numtheory[phi](e) ;
end do:
1+a;
end proc:
seq(A049113(n), n=1..40) ; # R. J. Mathar, Jan 09 2017
MATHEMATICA
pwrs2 = NestList[2#&, 1, 15];
Table[Length[Intersection[NestWhileList[EulerPhi[#]&, i, # > 1 &], pwrs2]], {i, 100}] (* Harvey P. Dale, Dec 12 2010 *)
PROG
(PARI) a(n)=while(n!=1<<valuation(n, 2), n=eulerphi(n)); valuation(n, 2)+1 \\ Charles R Greathouse IV, Feb 21 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved