The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A351054 First of three consecutive primes p,q,r such that p+q-r, p-q+r, -p+q+r are all prime. 1

%I #13 Feb 02 2022 07:19:25

%S 228647,642457,3678317,4424699,5507669,8439073,8527301,8545387,

%T 9207197,9490571,9843049,10023817,10148123,10670909,11621243,11697979,

%U 12208459,12409849,12687119,12845879,12947071,13590457,13940057,14377747,14511053,15309937,16628009,16713731,16982153,17073041,17302639

%N First of three consecutive primes p,q,r such that p+q-r, p-q+r, -p+q+r are all prime.

%C Each term is the second in an arithmetic progression of five primes, of which at least the second, third and fourth are consecutive primes.

%H Robert Israel, <a href="/A351054/b351054.txt">Table of n, a(n) for n = 1..1000</a>

%e a(3) = 3678317 is a term because it is prime, the next two primes are 3678347 and 3678377, and 3678317+3678347-3678377 = 3678287, 3678317-3678347+3678377 = 3678347, and -3678317+3678347+3678377 = 3678407 are all primes.

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

%p isprime(p+q-r) and isprime(p-q+r) and isprime(-p+q+r)

%p end proc:

%p p:= 2: q:= 3: r:= 5: R:= NULL: count:= 0:

%p while r < 10^8 do

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

%p if f(p,q,r) then count:= count+1; R:= R,p fi

%p od:

%p R;

%o (Python)

%o from sympy import isprime, nextprime

%o def c(p, q, r): return isprime(p+q-r) and isprime(p-q+r) and isprime(-p+q+r)

%o def afind():

%o p, q, r = 2, 3, 5

%o while True:

%o if c(p, q, r): print(p, end=", ")

%o p, q, r = q, r, nextprime(r)

%o afind() # _Michael S. Branicky_, Jan 30 2022

%K nonn

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, Jan 30 2022

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 8 05:45 EDT 2024. Contains 373207 sequences. (Running on oeis4.)