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.

A097889 Numbers that are products of (at least two) consecutive primes.

This page as a plain text file.
%I A097889 #44 Aug 30 2024 02:55:27
%S A097889 6,15,30,35,77,105,143,210,221,323,385,437,667,899,1001,1147,1155,
%T A097889 1517,1763,2021,2310,2431,2491,3127,3599,4087,4199,4757,5005,5183,
%U A097889 5767,6557,7387,7429,8633,9797,10403,11021,11663,12317,12673,14351,15015,16637,17017
%N A097889 Numbers that are products of (at least two) consecutive primes.
%C A097889 Subsequence of A073485; A073490(a(n)) = 0. - _Reinhard Zumkeller_, Nov 20 2004
%C A097889 A proper subset of A073485. - _Robert G. Wilson v_, Jun 11 2010
%C A097889 A192280(a(n)) * (1 - A010051(a(n))) = 1. - _Reinhard Zumkeller_, Aug 26 2011 [corrected by _Jason Yuen_, Aug 29 2024]
%C A097889 The Heinz numbers of the partitions into at least 2 consecutive parts. The Heinz number of an integer partition p = [p_1, p_2, ..., p_r] is defined as Product(p_j-th prime, j=1...r) (concept used by _Alois P. Heinz_ in A215366 as an "encoding" of a partition). Examples: (i) 105 (=3*5*7) is in the sequence because it is the Heinz number of the partition [2,3,4]; (ii) 108 (= 2*2*3*3*3) is not in the sequence because it is the Heinz number of the partition [1,1,2,2,2]. - _Emeric Deutsch_, Oct 02 2015
%H A097889 Reinhard Zumkeller, <a href="/A097889/b097889.txt">Table of n, a(n) for n = 1..10000</a>
%F A097889 a(n) ~ n^2 log^2 n. - _Charles R Greathouse IV_, Oct 24 2012
%e A097889 1001 = 7 * 11 * 13.
%p A097889 isA097889 := proc(n)
%p A097889     local plist,p,i ;
%p A097889     plist := sort(convert(numtheory[factorset](n),list)) ;
%p A097889     if nops(plist) < 2 then
%p A097889         return false;
%p A097889     end if;
%p A097889     for i from 1 to nops(plist) do
%p A097889         p := op(i,plist) ;
%p A097889         if modp(n,p^2) = 0 then
%p A097889             return false;
%p A097889         end if;
%p A097889         if i > 1 then
%p A097889             if nextprime(op(i-1,plist)) <> p then
%p A097889                 return false;
%p A097889             end if;
%p A097889         end if;
%p A097889     end do:
%p A097889     true;
%p A097889 end proc:
%p A097889 for n from 1 to 1000 do
%p A097889     if isA097889(n) then
%p A097889         printf("%d,",n);
%p A097889     end if;
%p A097889 end do: # _R. J. Mathar_, Jan 12 2016
%t A097889 a = {}; Do[ AppendTo[a, Apply[ Times, (Prime /@ Partition[ Range[30], n, i]), 1]], {n, 2, 6}, {i, n - 1}]; Take[ Union[ Flatten[ a]], 45] (* _Robert G. Wilson v_, Sep 24 2004 *)
%o A097889 (Haskell)
%o A097889 import Data.Set (singleton, deleteFindMin, insert)
%o A097889 a097889 n = a097889_list !! (n-1)
%o A097889 a097889_list = f $ singleton (6, 2, 3) where
%o A097889    f s = y : f (insert (w, p, q') $ insert (w `div` p, a151800 p, q') s')
%o A097889          where w = y * q'; q' = a151800 q
%o A097889                ((y, p, q), s') = deleteFindMin s
%o A097889 -- _Reinhard Zumkeller_, May 12 2015, Aug 26 2011
%o A097889 (PARI) list(lim)=my(v=List(), p, t); for(e=2, log(lim+.5)\log(2), p=1; t=prod(i=1, e-1, prime(i)); forprime(q=prime(e), lim, t*=q/p; if(t>lim, next(2)); listput(v, t); p=nextprime(p+1))); vecsort(Vec(v)) \\ _Charles R Greathouse IV_, Oct 24 2012
%o A097889 (Python)
%o A097889 import heapq
%o A097889 from sympy import sieve
%o A097889 sieve.extend(10**6)
%o A097889 primes = list(sieve._list)
%o A097889 def prime(n): return primes[n-1]
%o A097889 def aupton(terms, verbose=False):
%o A097889     p = prime(1)*prime(2); h = [(p, 1, 2)]; nextcount = 3; alst = []
%o A097889     while len(alst) < terms:
%o A097889         (v, s, l) = heapq.heappop(h)
%o A097889         alst.append(v)
%o A097889         if verbose: print(f"{v}, [= Prod_{{i = {s}..{l}}} prime(i)]")
%o A097889         if v >= p:
%o A097889             p *= prime(nextcount)
%o A097889             heapq.heappush(h, (p, 1, nextcount))
%o A097889             nextcount += 1
%o A097889         v //= prime(s); s += 1; l += 1; v *= prime(l)
%o A097889         heapq.heappush(h, (v, s, l))
%o A097889     return alst
%o A097889 print(aupton(45)) # _Michael S. Branicky_, Jun 15 2021
%Y A097889 Union of A006094, A046301, A046302, A046303, A046324, A046325, A046326, A046327, etc.
%Y A097889 Cf. A050936.
%Y A097889 Intersection of A073485 and A002808.
%Y A097889 Cf. A151800, A215366.
%K A097889 nonn,easy
%O A097889 1,1
%A A097889 Bart la Bastide (bart(AT)xs4all.nl), Sep 21 2004
%E A097889 More terms from _Robert G. Wilson v_, Sep 24 2004
%E A097889 Data corrected for n > 41 by _Reinhard Zumkeller_, Aug 26 2011