OFFSET
1,1
LINKS
Reinhard Zumkeller and Jud McCranie, Table of n, a(n) for n = 1..92 (first 75 numbers from Reinhard Zumkeller)
Eric Weisstein's World of Mathematics, Collatz Problem
Wikipedia, Collatz conjecture
EXAMPLE
a(6) = 7 because the Collatz trajectory of 7 is {7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1}, containing 6 primes {7, 11, 17, 13, 5, 2}, and 7 is the smallest positive integer for which exactly 6 primes occur via this trajectory.
MATHEMATICA
Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; nn = 50; t = Table[0, {nn}]; t[[1]] = 2; todo = nn - 1; n = 3; While[todo > 0, ps = Length[Select[Collatz[n], PrimeQ]]; If[ps <= nn && t[[ps]] == 0, t[[ps]] = n; todo--]; n = n + 2]; t (* T. D. Noe, Apr 02 2012 *)
With[{lst=Table[Count[NestWhileList[If[EvenQ[#], #/2, 3#+1]&, n, #>1&], _?PrimeQ], {n, 71000}]}, Table[Position[lst, k, 1, 1], {k, 50}]//Flatten] (* Harvey P. Dale, Sep 08 2018 *)
PROG
(PARI) np(n)=my(t=1); while(n>2, t+=isprime(n); if(n%2, n+=n>>1+1, n>>=1)); t
v=vector(40); n=1; while(1, t=np(n++); if(t<=#v&&v[t]==0, v[t]=n; if(vecmin(v), return(v)))) \\ Charles R Greathouse IV, Apr 01 2012
(Haskell)
import Data.List (elemIndex)
import Data.Maybe (fromJust)
a181921 = (+ 1) . fromJust . (`elemIndex` a078350_list)
-- Reinhard Zumkeller, Apr 03 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
G. L. Honaker, Jr., Apr 01 2012
EXTENSIONS
a(13)-a(50) from Charles R Greathouse IV, Apr 01 2012
STATUS
approved