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!)
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
Sequence in context: A126659 A246917 A102294 * A021287 A124887 A304903
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Dec 01 2022
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 August 24 16:25 EDT 2024. Contains 375417 sequences. (Running on oeis4.)