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

%I #44 Aug 30 2024 02:55:27

%S 6,15,30,35,77,105,143,210,221,323,385,437,667,899,1001,1147,1155,

%T 1517,1763,2021,2310,2431,2491,3127,3599,4087,4199,4757,5005,5183,

%U 5767,6557,7387,7429,8633,9797,10403,11021,11663,12317,12673,14351,15015,16637,17017

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

%C Subsequence of A073485; A073490(a(n)) = 0. - _Reinhard Zumkeller_, Nov 20 2004

%C A proper subset of A073485. - _Robert G. Wilson v_, Jun 11 2010

%C A192280(a(n)) * (1 - A010051(a(n))) = 1. - _Reinhard Zumkeller_, Aug 26 2011 [corrected by _Jason Yuen_, Aug 29 2024]

%C 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 Reinhard Zumkeller, <a href="/A097889/b097889.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) ~ n^2 log^2 n. - _Charles R Greathouse IV_, Oct 24 2012

%e 1001 = 7 * 11 * 13.

%p isA097889 := proc(n)

%p local plist,p,i ;

%p plist := sort(convert(numtheory[factorset](n),list)) ;

%p if nops(plist) < 2 then

%p return false;

%p end if;

%p for i from 1 to nops(plist) do

%p p := op(i,plist) ;

%p if modp(n,p^2) = 0 then

%p return false;

%p end if;

%p if i > 1 then

%p if nextprime(op(i-1,plist)) <> p then

%p return false;

%p end if;

%p end if;

%p end do:

%p true;

%p end proc:

%p for n from 1 to 1000 do

%p if isA097889(n) then

%p printf("%d,",n);

%p end if;

%p end do: # _R. J. Mathar_, Jan 12 2016

%t 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 (Haskell)

%o import Data.Set (singleton, deleteFindMin, insert)

%o a097889 n = a097889_list !! (n-1)

%o a097889_list = f $ singleton (6, 2, 3) where

%o f s = y : f (insert (w, p, q') $ insert (w `div` p, a151800 p, q') s')

%o where w = y * q'; q' = a151800 q

%o ((y, p, q), s') = deleteFindMin s

%o -- _Reinhard Zumkeller_, May 12 2015, Aug 26 2011

%o (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 (Python)

%o import heapq

%o from sympy import sieve

%o sieve.extend(10**6)

%o primes = list(sieve._list)

%o def prime(n): return primes[n-1]

%o def aupton(terms, verbose=False):

%o p = prime(1)*prime(2); h = [(p, 1, 2)]; nextcount = 3; alst = []

%o while len(alst) < terms:

%o (v, s, l) = heapq.heappop(h)

%o alst.append(v)

%o if verbose: print(f"{v}, [= Prod_{{i = {s}..{l}}} prime(i)]")

%o if v >= p:

%o p *= prime(nextcount)

%o heapq.heappush(h, (p, 1, nextcount))

%o nextcount += 1

%o v //= prime(s); s += 1; l += 1; v *= prime(l)

%o heapq.heappush(h, (v, s, l))

%o return alst

%o print(aupton(45)) # _Michael S. Branicky_, Jun 15 2021

%Y Union of A006094, A046301, A046302, A046303, A046324, A046325, A046326, A046327, etc.

%Y Cf. A050936.

%Y Intersection of A073485 and A002808.

%Y Cf. A151800, A215366.

%K nonn,easy

%O 1,1

%A Bart la Bastide (bart(AT)xs4all.nl), Sep 21 2004

%E More terms from _Robert G. Wilson v_, Sep 24 2004

%E Data corrected for n > 41 by _Reinhard Zumkeller_, Aug 26 2011