login
a(n) is the smallest starting value that produces a Collatz sequence in which n occurs.
10

%I #18 Jan 15 2015 03:39:59

%S 1,2,3,3,3,6,7,3,9,3,7,12,7,9,15,3,7,18,19,7,21,7,15,24,25,7,27,9,19,

%T 30,27,21,33,7,15,36,37,25,39,7,27,42,43,19,45,15,27,48,43,33,51,7,15,

%U 54,55,37,57,19,39,60,27,27,63,21,43,66,39,45,69,15,27,72,73,43,75,25

%N a(n) is the smallest starting value that produces a Collatz sequence in which n occurs.

%C a(n) <= n. - _Robert G. Wilson v_, Jan 14 2015

%H T. D. Noe, <a href="/A070167/b070167.txt">Table of n, a(n) for n=1..10000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/CollatzProblem.html">Collatz Sequence</a>

%H <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>

%t Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; nn = 100; t = Table[0, {nn}]; n = 0; zeros = nn; While[zeros > 0, n++; c = Collatz[n]; Do[If[i <= nn && t[[i]] == 0, t[[i]] = n; zeros--], {i, c}]]; t (* _T. D. Noe_, Dec 03 2012 *)

%o (Haskell)

%o import Data.List (findIndex)

%o import Data.Maybe (fromJust)

%o a070167 n = fromJust (findIndex (elem n) a070165_tabf) + 1

%o -- _Reinhard Zumkeller_, Jan 02 2013

%Y Cf. A006667, A070165.

%Y Cf. A010120, A054646.

%K nonn

%O 1,2

%A _Eric W. Weisstein_, Apr 23 2002