|
|
A032358
|
|
Number of iterations of phi(n) needed to reach 2.
|
|
8
|
|
|
0, 1, 1, 2, 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 3, 4, 2, 3, 3, 3, 3, 4, 3, 4, 3, 3, 3, 4, 3, 4, 4, 4, 4, 4, 3, 4, 3, 4, 4, 5, 3, 4, 4, 4, 4, 5, 4, 4, 4, 5, 4, 5, 3, 5, 4, 4, 4, 5, 4, 5, 4, 4, 5, 5, 4, 5, 5, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 5
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
2,4
|
|
COMMENTS
|
Shapiro asks for a proof that for every n > 1 there is a prime p such that a(p) = n. [Charles R Greathouse IV, Oct 28 2011]
|
|
LINKS
|
|
|
FORMULA
|
Shapiro proves that log_3(n/2) <= a(n) < log_2(n) and also
a(mn) = a(m) + a(n) if either m or n is odd and a(mn) = a(m) + a(n) + 1 if m and n are even.
(End)
|
|
MAPLE
|
local a, phin ;
if n <=2 then
0;
else
phin := n ;
a := 0 ;
for a from 1 do
phin := numtheory[phi](phin) ;
if phin = 2 then
return a;
end if;
end do:
end if;
end proc:
|
|
MATHEMATICA
|
Table[Length[NestWhileList[EulerPhi[#]&, n, #>2&]]-1, {n, 3, 80}] (* Harvey P. Dale, May 01 2011 *)
|
|
PROG
|
(Haskell)
a032358 = length . takeWhile (/= 2) . (iterate a000010)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nice,nonn,easy
|
|
AUTHOR
|
Ursula Gagelmann (gagelmann(AT)altavista.net)
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|