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.

A181921 The smallest positive integer that produces exactly n primes in a Collatz trajectory.

This page as a plain text file.
%I A181921 #32 Feb 16 2025 08:33:13
%S A181921 2,5,3,15,11,7,19,43,67,89,39,127,123,223,111,351,175,155,103,63,107,
%T A181921 71,47,31,27,97,193,171,231,487,1087,763,2223,2143,1263,1071,4011,
%U A181921 6919,8127,13183,6591,6943,6171,10971,46443,48927,35295,17647,70589,47059
%N A181921 The smallest positive integer that produces exactly n primes in a Collatz trajectory.
%H A181921 Reinhard Zumkeller and Jud McCranie, <a href="/A181921/b181921.txt">Table of n, a(n) for n = 1..92</a> (first 75 numbers from Reinhard Zumkeller)
%H A181921 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/CollatzProblem.html">Collatz Problem</a>
%H A181921 Wikipedia, <a href="http://en.wikipedia.org/wiki/Collatz_conjecture">Collatz conjecture</a>
%H A181921 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%e A181921 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.
%t A181921 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 *)
%t A181921 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 *)
%o A181921 (PARI) np(n)=my(t=1);while(n>2,t+=isprime(n);if(n%2,n+=n>>1+1,n>>=1));t
%o A181921 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
%o A181921 (Haskell)
%o A181921 import Data.List (elemIndex)
%o A181921 import Data.Maybe (fromJust)
%o A181921 a181921 = (+ 1) . fromJust . (`elemIndex` a078350_list)
%o A181921 -- _Reinhard Zumkeller_, Apr 03 2012
%Y A181921 Cf. A055509, A078350.
%K A181921 nonn
%O A181921 1,1
%A A181921 _G. L. Honaker, Jr._, Apr 01 2012
%E A181921 a(13)-a(50) from _Charles R Greathouse IV_, Apr 01 2012