|
|
A230010
|
|
a(n) = smallest prime p such that n*(p^2 + 1) + 1 is also prime or 0 if no such prime exists.
|
|
1
|
|
|
3, 2, 3, 3, 5, 2, 3, 2, 13, 3, 13, 2, 3, 2, 3, 0, 5, 3, 3, 2, 3, 0, 5, 3, 3, 2, 3, 3, 7, 2, 3, 7, 3, 0, 5, 2, 0, 2, 7, 3, 11, 2, 3, 13, 5, 3, 5, 2, 3, 2, 5, 3, 13, 2, 0, 2, 3, 0, 23, 3, 0, 2, 3, 3, 7, 2, 0, 11, 3, 3, 5, 5, 0, 7, 3, 3, 5, 5, 0, 2, 3, 3, 17, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
If n*3^2+n+1 is not prime and (n-1) is divisible by 3 then a(n) = 0.
The first such case is n = 16 when 161 is not prime and (16-1) is 5*3, while a(1,4,7,10,13) = 3.
|
|
LINKS
|
|
|
EXAMPLE
|
a(4) = 3, since p = 3 is prime and 4*p^2 + 4 + 1 = 36 + 4 + 1 = 41 is also prime.
|
|
PROG
|
(PARI) a(n) = {if (! isprime(10*n+1) && !((n-1) % 3), return (0)); p = 2; while ( !isprime(n*p^2 + n + 1), p = nextprime(p+1)); p; } \\ Michel Marcus, Dec 20 2013
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|