[go: up one dir, main page]

login
A070167
a(n) is the smallest starting value that produces a Collatz sequence in which n occurs.
10
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, 30, 27, 21, 33, 7, 15, 36, 37, 25, 39, 7, 27, 42, 43, 19, 45, 15, 27, 48, 43, 33, 51, 7, 15, 54, 55, 37, 57, 19, 39, 60, 27, 27, 63, 21, 43, 66, 39, 45, 69, 15, 27, 72, 73, 43, 75, 25
OFFSET
1,2
COMMENTS
a(n) <= n. - Robert G. Wilson v, Jan 14 2015
MATHEMATICA
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 *)
PROG
(Haskell)
import Data.List (findIndex)
import Data.Maybe (fromJust)
a070167 n = fromJust (findIndex (elem n) a070165_tabf) + 1
-- Reinhard Zumkeller, Jan 02 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric W. Weisstein, Apr 23 2002
STATUS
approved