|
|
A358790
|
|
a(n) is the least prime p such that (2*n+1)^2 + p^2 is twice a prime.
|
|
2
|
|
|
3, 5, 3, 3, 5, 5, 3, 7, 3, 5, 5, 3, 3, 7, 5, 11, 5, 3, 7, 5, 5, 3, 13, 3, 5, 11, 3, 13, 5, 5, 5, 5, 7, 7, 5, 31, 5, 7, 3, 11, 19, 3, 3, 5, 11, 5, 5, 3, 7, 19, 5, 3, 11, 5, 5, 5, 3, 7, 5, 31, 5, 5, 3, 3, 19, 11, 3, 7, 5, 11, 41, 17, 13, 13, 5, 29, 5, 7, 3, 5, 5, 5, 13, 13, 5, 5, 3, 11, 13, 5, 19
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
If n == 0 or 4 (mod 5), a(n) == 0, 1 or 4 (mod 5).
If n == 1 or 3 (mod 5), a(n) == 0, 2 or 3 (mod 5).
If n == 2 (mod 5), a(n) == 1, 2, 3 or 4 (mod 5).
|
|
LINKS
|
|
|
EXAMPLE
|
a(3) = 3 because 3 is prime, (2*3+1)^2 + 3^2 = 2*29 where 29 is prime, and no smaller prime than 3 works.
|
|
MAPLE
|
f:= proc(n) local s, p;
s:= (2*n+1)^2; p:= 2;
do
p:= nextprime(p);
if isprime((s+p^2)/2) then return p fi
od
end proc:
map(f, [$0..100]);
|
|
MATHEMATICA
|
a[n_] := Module[{p = 3}, While[! PrimeQ[((2*n + 1)^2 + p^2)/2], p = NextPrime[p]]; p]; Array[a, 100, 0] (* Amiram Eldar, Dec 01 2022 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|