OFFSET
1,1
COMMENTS
REFERENCES
J. Shallit and D. Wilson, The "3x+1" Problem and Finite Automata, Bulletin of the EATCS #46 (1992) pp. 182-185.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
J. Shallit and D. Wilson, The "3x+1" Problem and Finite Automata, Bulletin of the EATCS #46 (1992) pp. 182-185.
Eric Weisstein's World of Mathematics, Collatz Problem
Wikipedia, Collatz conjecture
EXAMPLE
The Collatz trajectory of 11 is (11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1), which contains 5 odd integers.
MATHEMATICA
Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; countOdd[lst_] := Length[Select[lst, OddQ]]; Select[Range[2000], countOdd[Collatz[#]] == 5 &] (* T. D. Noe, Dec 03 2012 *)
PROG
(Haskell)
import Data.List (elemIndices)
a062055 n = a062055_list !! (n-1)
a062055_list = map (+ 1) $ elemIndices 5 a078719_list
-- Reinhard Zumkeller, Oct 08 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved