login
Primes p such that p + q*(q-p) and q + p*(q-p) are prime, where q is the next prime after p.
1

%I #11 Jul 05 2021 12:03:54

%S 2,3,5,23,59,61,83,151,233,263,269,293,373,401,433,503,541,619,701,

%T 971,1103,1433,1493,1601,1621,1861,1949,2099,2179,2371,2441,2543,2741,

%U 2851,2903,2999,3083,3181,3313,3413,3559,3631,4073,4093,4549,4591,4643,5039,5081,5471,5711,5749

%N Primes p such that p + q*(q-p) and q + p*(q-p) are prime, where q is the next prime after p.

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

%p R:= NULL: count:= 0:

%p q:= 2:

%p do

%p p:= q; q:= nextprime(p);

%p if isprime(p+(q-p)*q) and isprime(q+(q-p)*p) then

%p count:= count+1;

%p R:= R, p;

%p if count = 100 then break fi

%p fi

%p od:

%p R;

%t Do[a=Prime[k]+Prime[k+1]*(Prime[k+1]-Prime[k]);b=Prime[k+1]+Prime[k]*(Prime[k+1]-Prime[k]);If[PrimeQ[a]&&PrimeQ[b],Print[Prime[k]]],{k,1,757}] (* _Metin Sariyar_, Sep 23 2019 *)

%t chpQ[{a_,b_}]:=AllTrue[{a+b(b-a),b+a(b-a)},PrimeQ]; Select[Partition[ Prime[ Range[800]],2,1],chpQ][[All,1]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Jul 05 2021 *)

%Y Includes A174920.

%K nonn

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, Sep 22 2019