OFFSET
1,1
COMMENTS
REFERENCES
J. R. Goodwin, Results on the Collatz Conjecture, Sci. Ann. Comput. Sci. 13 (2003) pp. 1-16
J. Shallit and D. Wilson, The "3x+1" Problem and Finite Automata, Bulletin of the EATCS #46 (1992) pp. 182-185.
LINKS
Reinhard Zumkeller and David A. Corneth, Table of n, a(n) for n = 1..16191 (first 250 terms from Reinhard Zumkeller, terms < 10^25)
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
FORMULA
The two formulas giving this sequence are listed in Corollary 3.1 and Corollary 3.2 in J. R. Goodwin with the following caveats: the value x cannot equal zero in Corollary 3.2, one must multiply the formulas by all powers of 2 (2^1, 2^2, ...) to get the evens. - Jeffrey R. Goodwin, Oct 26 2011
EXAMPLE
The Collatz trajectory of 3 is (3,10,5,16,8,4,2,1), which contains 3 odd integers.
MATHEMATICA
Collatz[n_?OddQ] := (3n + 1)/2; Collatz[n_?EvenQ] := n/2; oddIntCollatzCount[n_] := Length[Select[NestWhileList[Collatz, n, # != 1 &], OddQ]]; Select[Range[4000], oddIntCollatzCount[#] == 3 &] (* Alonso del Arte, Oct 28 2011 *)
PROG
(Haskell)
import Data.List (elemIndices)
a062053 n = a062053_list !! (n-1)
a062053_list = map (+ 1) $ elemIndices 3 a078719_list
-- Reinhard Zumkeller, Oct 08 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved