login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Smallest number m such that exactly n triples (p,q,r) of distinct primes exist with m=p*q+r.
2

%I #8 Mar 09 2018 02:48:22

%S 1,11,13,23,17,37,53,62,81,99,93,105,118,122,148,152,165,166,208,224,

%T 214,225,232,250,284,285,308,314,332,346,326,382,388,400,448,476,458,

%U 494,454,518,520,478,525,530,578,598,640,602,632,716,634,740,710,692

%N Smallest number m such that exactly n triples (p,q,r) of distinct primes exist with m=p*q+r.

%C A100951(a(n)) = n and A100951(m) <> n for m < a(n);

%C a(42) = 525 seems to be the largest odd term.

%C Note that switching p and q does not make a different triple. - _Robert Israel_, Mar 09 2018

%H Robert Israel, <a href="/A160373/b160373.txt">Table of n, a(n) for n = 0..6567</a> (n=0..500 from Reinhard Zumkeller)

%e A100951(37) = #{2*3+31,2*7+23,2*13+11,2*17+3,5*7+2} = 5.

%p N:= 10^4: # to get terms before the first term > N

%p Primes:= select(isprime, [2, seq(i,i=3..N,2)]):

%p V:= Vector(N):

%p for r in Primes do

%p for j from 1 while Primes[j]^2 <= N do

%p p:= Primes[j];

%p if p = r then next fi;

%p for k from j+1 while p*Primes[k]+r <= N do

%p q:= Primes[k];

%p if q = r then next fi;

%p V[p*q+r]:= V[p*q+r]+1;

%p od

%p od

%p od:

%p mv:= max( V):

%p F:= Vector(mv):

%p for i from 1 to N do

%p if V[i] > 0 and F[V[i]] = 0 then F[V[i]]:= i fi

%p od:

%p F0:= min(select(t -> F[t] = 0, [$1..max(V)])):

%p 1, seq(F[i],i=1..F0-1); # _Robert Israel_, Mar 09 2018

%p N:= 10^4: # to get terms before the first term > N

%p Primes:= select(isprime, [2, seq(i,i=3..N,2)]):

%p V:= Vector(N):

%p for r in Primes do

%p for j from 1 while Primes[j]^2 <= N do

%p p:= Primes[j];

%p if p = r then next fi;

%p for k from j+1 to nops(Primes) while p*Primes[k]+r <= N do

%p q:= Primes[k];

%p if q = r then next fi;

%p V[p*q+r]:= V[p*q+r]+1;

%p od

%p od

%p od:

%p mv:= max( V):

%p F:= Vector(mv):

%p for i from 1 to N do

%p if V[i] > 0 and F[V[i]] = 0 then F[V[i]]:= i fi

%p od:

%p F0:= min(select(t -> F[t] = 0, [$1..max(V)])):

%p if F0 = infinity then F0:= mv fi:

%p 1, seq(F[i],i=1..F0-1); # _Robert Israel_, Mar 09 2018

%K nonn

%O 0,2

%A _Reinhard Zumkeller_, May 11 2009