OFFSET
0,1
COMMENTS
If p = prime(m) is a prime such that the next n primes are p+2*k^2 for k=1..n, then A212769(m+k-1) = 2*p+1 for k=1..n.
a(12) > 10^15. - Martin Ehrenstein, Jan 31 2022
EXAMPLE
a(3) = 569 because the next 3 primes after 569 are 571 = 569 + 2*1^2, 577 = 569 + 2*2^2, 587 = 569 + 2*3^2, and 569 is the first prime that works.
MAPLE
P:= select(isprime, [2, seq(i, i=3..2*10^6, 2)]):
f:= proc(n) local k;
for k from 1 do
if P[n+k] <> P[n]+2*k^2 then return k-1 fi
od
end proc:
V:= Array(0..6):
for n from 1 to nops(P)-21 do
v:= H(n);
if V[v] = 0 then V[v]:= P[n] fi;
od:
convert(V, list);
PROG
(Python)
from sympy import prime, nextprime
def A350868(n):
if n < 2:
return 2+n
qlist = [prime(i)-2 for i in range(2, n+2)]
p = prime(n+1)
mlist = [2*k**2 for k in range(1, n+1)]
while True:
if qlist == mlist:
return p-mlist[-1]
qlist = [q-qlist[0] for q in qlist[1:]]
r = nextprime(p)
qlist.append(r-p+qlist[-1])
p = r # Chai Wah Wu, Jan 24 2022
CROSSREFS
KEYWORD
nonn,more
AUTHOR
J. M. Bergot and Robert Israel, Jan 20 2022
EXTENSIONS
a(7) from David A. Corneth, Jan 20 2022
a(8) from Chai Wah Wu, Jan 25 2022
a(9) from Martin Ehrenstein, Jan 26 2022
a(10)-a(11) from Martin Ehrenstein, Jan 31 2022
STATUS
approved