cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

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

Views

Author

Eric W. Weisstein, Apr 23 2002

Keywords

Comments

a(n) <= n. - Robert G. Wilson v, Jan 14 2015

Crossrefs

Programs

  • Haskell
    import Data.List (findIndex)
    import Data.Maybe (fromJust)
    a070167 n = fromJust (findIndex (elem n) a070165_tabf) + 1
    -- Reinhard Zumkeller, Jan 02 2013
  • 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 *)