login
A340212
a(n) is the least k > 0 such that k*prime(n)+prime(n-1) and k*prime(n)+prime(n+1) are both prime.
4
2, 6, 6, 2, 2, 6, 6, 24, 12, 24, 20, 12, 12, 28, 12, 24, 66, 20, 24, 6, 6, 6, 14, 36, 2, 14, 20, 8, 18, 12, 54, 6, 38, 102, 10, 120, 42, 28, 42, 38, 8, 20, 2, 18, 10, 12, 2, 6, 6, 114, 32, 36, 4, 24, 12, 120, 36, 14, 32, 18, 8, 74, 20, 54, 30, 90, 36, 6, 6, 54, 30, 40, 6, 6, 24, 26, 32, 8, 12, 12
OFFSET
3,1
COMMENTS
All terms are even.
a(n) = 2 if and only if prime(n) is in A125146.
LINKS
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