OFFSET
1,2
COMMENTS
A given term k appears A131450(k) times. - Flávio V. Fernandes, Mar 13 2022
LINKS
MAPLE
A006370 := proc(n) if type(n, 'even') then n/2; else 3*n+1 ; end if; end proc:
A006577 := proc(n) a := 0 ; x := n ; while x > 1 do x := A006370(x) ; a := a+1 ; end do; a ; end proc:
A006667 := proc(n) a := 0 ; x := n ; while x > 1 do if type(x, 'even') then x := x/2 ; else x := 3*x+1 ; a := a+1 ; end if; end do; a ; end proc:
A166549 := proc(n) A006577(2*n-1)-A075680(n) ; end: seq(A166549(n), n=1..120) ; # R. J. Mathar, Oct 18 2009
# second Maple program:
b:= proc(n) option remember; `if`(n=1, 0,
1+b(`if`(n::even, n/2, (3*n+1)/2)))
end:
a:= n-> b(2*n-1):
seq(a(n), n=1..75); # Alois P. Heinz, Mar 14 2022
MATHEMATICA
b[n_] := b[n] = If[n == 1, 0, 1 + b[If[EvenQ[n], n/2, (3n+1)/2]]];
a[n_] := b[2n-1];
Table[a[n], {n, 1, 75}] (* Jean-François Alcover, Apr 22 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jimin Park, Oct 16 2009
EXTENSIONS
Edited and extended by R. J. Mathar, Oct 18 2009
STATUS
approved