login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A342821 a(n) is the least prime p such that p*n+(n-1) and p*n-(n-1) are both prime, or 0 if there is no such p. 2
2, 2, 3, 2, 3, 2, 5, 3, 5, 2, 3, 29, 7, 0, 3, 2, 0, 2, 11, 3, 3, 5, 0, 19, 5, 3, 29, 2, 0, 2, 13, 0, 3, 29, 3, 2, 41, 0, 5, 11, 3, 11, 5, 0, 5, 2, 0, 3, 5, 3, 19, 19, 3, 11, 7, 3, 11, 2, 0, 2, 7, 0, 3, 5, 0, 2, 5, 3, 11, 5, 0, 19, 13, 0, 31, 7, 0, 2, 19, 0, 7, 11, 3, 5, 19, 0, 5, 2, 0, 3, 7, 0, 5 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
If n == 2 (mod 3) then a(n) <= 3.
LINKS
EXAMPLE
a(7) = 5 because 5*7+6 = 41 and 5*7-6 = 29 are prime, and 5 is the least prime that works.
MAPLE
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]);
CROSSREFS
Cf. A342822.
Sequence in context: A331597 A356231 A339502 * A165916 A096013 A072380
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Apr 25 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 18:04 EDT 2024. Contains 371254 sequences. (Running on oeis4.)