OFFSET
1,1
COMMENTS
The Collatz (or 3x+1) function is f(x) = x/2 if x is even, 3x+1 if x is odd.
The Collatz trajectory of n is obtained by applying f repeatedly to n until 1 is reached.
Numbers m such that (s0 - 4s1)/2m = 1 where s0 is the sum of the even elements and s1 the sum of the odd elements in the Collatz trajectory of m. - Michel Lagneau, Aug 13 2018
If m is in the sequence then so is 2*m, so one would only have to check odd numbers. - David A. Corneth, Aug 13 2018
REFERENCES
J. Shallit and D. Wilson, The "3x+1" Problem and Finite Automata, Bulletin of the EATCS #46 (1992) pp. 182-185.
LINKS
David A. Corneth, Table of n, a(n) for n = 1..15549 (first 750 terms from Reinhard Zumkeller, terms < 10^15)
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.
Eric Weisstein's World of Mathematics, Collatz Problem
Wikipedia, Collatz conjecture
FORMULA
The twelve formulas giving this sequence are listed in Corollary 3.3 in J. R. Goodwin with the following caveats: the value x cannot equal zero in formulas (3.16) and (3.20), 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 17 is (17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1), which contains 4 odd integers. - Jeffrey R. Goodwin, Oct 26 2011
MATHEMATICA
col4Q[n_]:=Module[{c=NestWhileList[If[EvenQ[#], #/2, 3#+1]&, n, #!=1&]}, Count[c, _?OddQ]==4]; Select[Range[2500], col4Q] (* Harvey P. Dale, Mar 21 2011 *)
PROG
(Haskell)
import Data.List (elemIndices)
a062054 n = a062054_list !! (n-1)
a062054_list = map (+ 1) $ elemIndices 4 a078719_list
-- Reinhard Zumkeller, Oct 08 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved