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!)
A349586 First of four consecutive primes p,q,r,s such that 2*p+q+r+s, p+2*q+r+s, p+q+2*r+s and p+q+r+2*s are all prime. 1
659, 2351, 3967, 8429, 15091, 23599, 25127, 32789, 34471, 35171, 60859, 64969, 75941, 78367, 95111, 97649, 115183, 139891, 155773, 158803, 161059, 186023, 191707, 208933, 224443, 225949, 235813, 333341, 335693, 391789, 411337, 417119, 418637, 426541, 435647, 454253, 476611, 488339, 489449, 493169 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Robert Israel, Table of n, a(n) for n = 1..10000

EXAMPLE

a(3) = 3967 is a term because 3967, 3989, 4001, 4003 are four consecutive primes with 2*3967+3989+4001+4003=19927,

       3967+2*3989+4001+4003=19949,

       3967+3989+2*4001+4003=19961,

       3967+3989+4001+2*4003=19963, all prime.

MAPLE

R:= NULL: count:= 0:

q:= 2: r:= 3: s:= 5:

while count < 100 do

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

  S:= p+q+r+s;

  if isprime(p+S) and isprime(q+S) and isprime(r+S) and isprime(s+S) then

    count:= count+1; R:= R, p;

  fi

od:

R;

MATHEMATICA

Select[Partition[Select[Range[500000], PrimeQ], 4, 1], And @@ PrimeQ[# + Total[#]] &][[;; , 1]] (* Amiram Eldar, Nov 22 2021 *)

PROG

(Python)

from sympy import isprime, nextprime

def aupto(limit):

    p, q, r, s, alst = 2, 3, 5, 7, []

    while p <= limit:

        if all(isprime(p+q+r+s+k) for k in [p, q, r, s]): alst.append(p)

        p, q, r, s = q, r, s, nextprime(s)

    return alst

print(aupto(500000)) # Michael S. Branicky, Nov 22 2021

(PARI) list(lim)=my(v=List(), p, q, r); p=2; q=3; r=5; forprime(s=7, , if(p>lim, break); if(isprime(2*p+q+r+s) && isprime(p+2*q+r+s) && isprime(p+q+2*r+s) && isprime(p+q+r+2*s), listput(v, p)); p=q; q=r; r=s); Vec(v) \\ Charles R Greathouse IV, Nov 22 2021

CROSSREFS

Sequence in context: A252365 A198207 A171393 * A023294 A067235 A113171

Adjacent sequences:  A349583 A349584 A349585 * A349587 A349588 A349589

KEYWORD

nonn

AUTHOR

J. M. Bergot and Robert Israel, Nov 22 2021

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 26 07:27 EST 2022. Contains 350576 sequences. (Running on oeis4.)