|
|
A008908
|
|
(1 + number of halving and tripling steps to reach 1 in the Collatz (3x+1) problem), or -1 if 1 is never reached.
|
|
41
|
|
|
1, 2, 8, 3, 6, 9, 17, 4, 20, 7, 15, 10, 10, 18, 18, 5, 13, 21, 21, 8, 8, 16, 16, 11, 24, 11, 112, 19, 19, 19, 107, 6, 27, 14, 14, 22, 22, 22, 35, 9, 110, 9, 30, 17, 17, 17, 105, 12, 25, 25, 25, 12, 12, 113, 113, 20, 33, 20, 33, 20, 20, 108, 108, 7, 28, 28, 28, 15, 15, 15, 103
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
The number of steps (iterations of the map A006370) to reach 1 is given by A006577, this sequence counts 1 more. - M. F. Hasler, Nov 05 2017
When Collatz 3N+1 function is seen as an isometry over the dyadics, the halving step necessarily following each tripling is not counted, hence N -> N/2, if even, but N -> (3N+1)/2, if odd. Counting iterations of this map until reaching 1 leads to sequence A064433. [Michael Vielhaber (vielhaber(AT)gmail.com), Nov 18 2009]
|
|
REFERENCES
|
R. K. Guy, Unsolved Problems in Number Theory, E16.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = f(n,1) with f(n,x) = if n=1 then x else f(A006370(n),x+1).
|
|
MAPLE
|
a:= proc(n) option remember; 1+`if`(n=1, 0,
a(`if`(n::even, n/2, 3*n+1)))
end:
|
|
MATHEMATICA
|
Table[Length[NestWhileList[If[EvenQ[ # ], #/2, 3 # + 1] &, i, # != 1 &]], {i, 75}]
|
|
PROG
|
(Haskell)
a008908 = length . a070165_row
(Python)
def a(n):
if n==1: return 1
x=1
while True:
if n%2==0: n//=2
else: n = 3*n + 1
x+=1
if n<2: break
return x
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
EXTENSIONS
|
More terms from Larry Reeves (larryr(AT)acm.org), Apr 27 2001
|
|
STATUS
|
approved
|
|
|
|