OFFSET
1,2
LINKS
T. D. Noe, Table of n, a(n) for n=1..10000
FORMULA
a(n) = A006577(prime(n)). - Michel Marcus, Sep 07 2014
MATHEMATICA
ns[n_]:=Length[NestWhileList[If[EvenQ[#], #/2, 3#+1]&, n, #!=1&]]-1; ns/@ Prime[Range[70]] (* Harvey P. Dale, Jul 29 2014 *)
PROG
(PARI) for(n=2, 100, s=prime(n); t=0; while(s!=1, t++; if(s%2==0, s=s/2, s=3*s+1); if(s==1, print1(t, ", "); ); ))
(Python)
from sympy import prime
def a006577(n):
if n==1: return 0
x=0
while True:
if n%2==0: n//=2
else: n = 3*n + 1
x+=1
if n<2: break
return x
def a(n): return a006577(prime(n))
print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 05 2017
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Benoit Cloitre, May 17 2002
STATUS
approved