login
Numbers of the form k = p*q + p*r + q*r where p < q < r are distinct primes such that 2*k-p*q, 2*k-p*r and 2*k-q*r are prime.
2

%I #18 Jul 31 2020 10:03:11

%S 103,119,151,327,355,439,451,503,511,583,711,723,727,751,791,887,1063,

%T 1091,1119,1175,1223,1251,1447,1551,1647,1751,1951,1991,2071,2151,

%U 2583,2651,2743,2775,2791,2903,2915,2951,2967,3075,3079,3171,3191,3311,3335,3367,3371,3435,3491,3575,3579,3651

%N Numbers of the form k = p*q + p*r + q*r where p < q < r are distinct primes such that 2*k-p*q, 2*k-p*r and 2*k-q*r are prime.

%C The first term that occurs for two different triples (p,q,r) is 791, which corresponds to (p,q,r) = (3,5,97) and (3,17,37).

%C The first term that occurs for three different triples (p,q,r) is 66135, which corresponds to (p,q,r) = (11,71,797), (17,29,1427) and (17,59,857).

%C All terms == 3 (mod 4).

%C If p <> 3, then p,q,r are all congruent mod 6 so k is divisible by 3.

%C If 5 is not p or q, then two of (p,q,r) are congruent to each other mod 10.

%H Robert Israel, <a href="/A328805/b328805.txt">Table of n, a(n) for n = 1..10000</a>

%e a(3) = 151 is in the sequence because (p,q,r)=(3,7,13) are distinct primes such that p*q+p*r+q*r=151 and 2*151-p*q=281, 2*151-p*r=263 and 2*151-q*r=211 are primes.

%p N:= 4000: # to get all terms <= N

%p filter:= proc(p,q,r)

%p isprime(p*q+2*p*r+2*q*r) and isprime(2*p*q+p*r+2*q*r) and isprime(2*p*q+2*p*r+q*r)

%p end proc:

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

%p R:= {}:

%p for ip from 1 do

%p p:= Primes[ip];

%p if 3*p^2 >= N then break fi;

%p for iq from ip+1 do

%p q:= Primes[iq];

%p if 2*p*q + q^2 >= N then break fi;

%p for ir from iq+1 do

%p r:= Primes[ir];

%p s:= p*q + q*r + p*r;

%p if s > N then break fi;

%p if filter(p,q,r) then

%p R:= R union {s};

%p fi;

%p od od od:

%p sort(convert(R,list));

%t M = 4000; (* to get all terms <= M *)

%t filterQ[p_, q_, r_] := PrimeQ[p q + 2 p r + 2 q r] && PrimeQ[2 p q + p r + 2 q r] && PrimeQ[2 p q + 2 p r + q r];

%t primes = Select[Table[i, {i, 3, M/8, 2}], PrimeQ];

%t R = {};

%t For[ip = 1, True, ip++, p = primes[[ip]]; If[3 p^2 >= M, Break[]]; For[iq = ip + 1, True, iq++, q = primes[[iq]]; If[2 p q + q^2 >= M, Break[]]; For[ir = iq + 1, True, ir++, r = primes[[ir]]; s = p q + q r + p r; If[s > M, Break[]]; If[filterQ[p, q, r], R = Union[R, {s}]]]]];

%t R (* _Jean-François Alcover_, Jul 31 2020, after _Robert Israel_ *)

%Y Cf. A328822 (primes in this sequence).

%K nonn

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, Oct 27 2019