1,1

If n == 2 (mod 3) then a(n) <= 3.

Robert Israel, Table of n, a(n) for n = 1..10000

a(7) = 5 because 5*7+6 = 41 and 5*7-6 = 29 are prime, and 5 is the least prime that works.

f:= proc(n) local p, pmax;

p:= 1:

if n mod 3 = 2 then pmax := 3 else pmax := infinity fi;

while p < pmax do

p:= nextprime(p);

if isprime(n*p+n-1) and isprime(n*p-n+1) then return p fi;

od:

0

end proc:

map(f, [$1..100]);

Cf. A342822.

Sequence in context: A105560 A331597 A339502 * A165916 A096013 A072380

Adjacent sequences: A342818 A342819 A342820 * A342822 A342823 A342824

nonn

J. M. Bergot and Robert Israel, Apr 25 2021

approved