OFFSET
3,1
COMMENTS
All terms are even.
a(n) = 2 if and only if prime(n) is in A125146.
LINKS
Robert Israel, Table of n, a(n) for n = 3..10000
EXAMPLE
For n=3, prime(2)=3, prime(3)=5, prime(4)=7, and 2*5+3=13 and 2*5+7=17 are prime, so a(3)=2.
MAPLE
f:= proc(n) local p, q, r, k;
p:= ithprime(n);
q:= ithprime(n-1);
r:= ithprime(n+1);
for k from 2 by 2 do
if isprime(k*p+q) and isprime(k*p+r) then return k fi
od
end proc:
map(f, [$3..100]);
PROG
(PARI) a(n) = my(p=prime(n), k=1); while (! (isprime(k*p+precprime(p-1)) && isprime(k*p+nextprime(p+1))), k++); k; \\ Michel Marcus, Jan 01 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Dec 31 2020
STATUS
approved