%I #9 Nov 07 2020 20:41:23
%S 3,37,53,563,877,1297,3571,4327,6679,10487,11047,19463,19531,23557,
%T 26723,32363,32957,34253,34457,35527,84793,92779,98317,113167,120937,
%U 131933,133967,148193,148457,160073,174917,182627,205417,206237,219787,220897,245513,247759,257707,276637,289129,290663
%N Primes p such that (p*s) mod q and (p*s) mod r are a pair of twin primes, where q,r,s are the next primes after p.
%C Let g1 = q-p, g2 = r-q, g3 = s-r be the gaps between the consecutive primes p,q,r,s. Then p*s = (q-g1)*(q+g2+g3) == -g1*(g2+g3) (mod q) and similarly p*s == -(g1+g2)*g3 (mod r). According to Cramer's conjecture, g1*(g2+g3) < q and (g1+g2)*g3 < r for all but finitely many p: the only exception in this sequence appears to be p=3. When g1*(g2+g3) < q and (g1+g2)*g3 < r we have ((p*s) mod r) - ((p*s) mod q) = (r - (g1+g2)*g3) - (q - g1*(g2+g3)) = g2*(g1-g3+1). This is 2 (allowing the possibility of twin primes) if g2 = 2 and g3 = g1.
%H Robert Israel, <a href="/A338751/b338751.txt">Table of n, a(n) for n = 1..2700</a>
%e a(3) = 53 is a member because with p=53, q=59, r=61 and s=67 we have (53*67) mod 59 = 11 and (53*67) mod 61 = 13, and 11 and 13 are a pair of twin primes.
%p p2:= 2: p3:= 3: p4:= 5: R:= NULL: count:= 0:
%p while count < 100 do
%p p1:= p2; p2:= p3; p3:= p4;
%p p4:= nextprime(p4);
%p r2:= (p1*p4) mod p2;
%p r3:= (p1*p4) mod p3;
%p if r3 = r2 + 2 and isprime(r2) and isprime(r3) then
%p R:= R, p1; count:= count+1;
%p fi
%p od:
%p R;
%Y Cf. A338518.
%K nonn
%O 1,1
%A _J. M. Bergot_ and _Robert Israel_, Nov 06 2020