login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A351848
a(n) is the least prime p such that k*(p^2-1)+2*n+1 is prime for k=1..2*n, or 0 if there is no such p.
0
3, 7, 423281, 0
OFFSET
1,1
COMMENTS
If n == 1 (mod 3) and n > 1, then a(n) = 0.
a(5) > 10^10 if it is not 0.
EXAMPLE
a(2) = 7 because 5 + 1*(7^2-1) = 53, 5 + 2*(7^2-1) = 101, 5 + 3*(7^2-1) = 149 and 5 + 4*(7^2-1) = 197 are all prime.
MAPLE
f:= proc(n) local p, pmax, k;
if n mod 3 = 1 then
if n=1 then return 3 else return 0 fi
fi;
p:= 1:
while p < 10^8 do
p:= nextprime(p);
if andmap(isprime, [seq(k*(p^2-1)+2*n+1, k=1..2*n)]) then return p fi
od;
FAIL
end proc:
map(f, [$1..5]);
CROSSREFS
Sequence in context: A083461 A137029 A174307 * A137125 A103319 A341812
KEYWORD
nonn,more
AUTHOR
J. M. Bergot and Robert Israel, Feb 21 2022
STATUS
approved