[go: up one dir, main page]

login
A342504
Primes p such that (p*r+q*s)/2 is prime, where p,q,r,s are consecutive primes.
3
5, 7, 37, 53, 79, 97, 107, 109, 263, 293, 409, 463, 563, 571, 701, 853, 877, 1031, 1423, 1567, 1699, 1747, 1789, 2029, 2837, 2917, 2969, 3137, 3251, 3331, 3413, 3461, 3533, 3881, 3889, 4229, 4513, 4909, 4937, 5051, 5059, 5843, 6011, 6151, 6361, 6521, 6779, 7331, 7547, 7673, 8243, 8269, 8287, 8693
OFFSET
1,1
LINKS
EXAMPLE
a(3) = 37 is a term because 37,41,43,47 are consecutive primes and (37*43+41*47)/2 = 1759 is prime.
MAPLE
R:= NULL: count:= 0:
q:= 3: r:= 5: s:= 7:
while count < 100 do
p:= q; q:= r; r:= s; s:= nextprime(s);
if isprime((p*r+q*s)/2) then
count:= count+1; R:= R, p;
fi
od:
R;
PROG
(Python)
from sympy import isprime, nextprime
def aupton(terms):
alst, p, q, r, s = [], 2, 3, 5, 7
while len(alst) < terms:
if isprime((p*r + q*s)//2): alst.append(p)
p, q, r, s = q, r, s, nextprime(s)
return alst
print(aupton(54)) # Michael S. Branicky, Mar 14 2021
CROSSREFS
Sequence in context: A196203 A196473 A081851 * A192156 A322380 A006067
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Mar 14 2021
STATUS
approved