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

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 59th year, we have over 358,000 sequences, and we’ve crossed 10,300 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A263978 Least prime p such that n^2 + p^2 is prime, or 0 if none. 1
2, 3, 2, 5, 2, 5, 2, 3, 0, 3, 0, 7, 2, 11, 2, 5, 2, 5, 0, 3, 0, 5, 0, 5, 0, 5, 2, 5, 0, 11, 0, 3, 2, 5, 2, 5, 2, 3, 0, 3, 0, 5, 0, 19, 2, 5, 2, 13, 0, 7, 0, 3, 0, 11, 0, 11, 2, 3, 0, 13, 0, 3, 0, 11, 2, 29, 2, 5, 0, 3, 0, 5, 2, 5, 0, 5, 0, 7, 0, 7, 0, 3, 0, 11, 2, 11, 2, 3, 0, 11, 0, 7, 0, 5, 2, 5, 2, 3, 0, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

When n is odd, n^2 + p^2 is composite for all odd primes p, so a(n) = 2 or 0 according as n^2 + 2^2 is prime or not.

The locations of the zeros are in A263722.

The location of the first occurrence of prime(n) is A263466(n).

LINKS

Table of n, a(n) for n=1..100.

EXAMPLE

a(1) = 2 since 1^2 + 2^2 = 5 is prime.

a(2) = 3 since 2^2 + 2^2 = 8 is not prime but 2^2 + 3^2 = 13 is prime.

a(9) = 0 since 9^2 + 2^2 = 85 is not prime.

MATHEMATICA

f[n_] := If[OddQ[n] && ! PrimeQ[n^2 + 4], 0,

Block[{p = 2}, While[! PrimeQ[n^2 + p^2] && p < 1500, p = NextPrime@p];

p]]; Array[f, 100]

CROSSREFS

Cf. A240130, A240131, A263466, A263721, A263722, A263726, A263977.

Sequence in context: A258581 A108501 A166226 * A326810 A263726 A328317

Adjacent sequences: A263975 A263976 A263977 * A263979 A263980 A263981

KEYWORD

nonn

AUTHOR

Jonathan Sondow and Robert G. Wilson v, Nov 06 2015

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 December 1 23:44 EST 2022. Contains 358485 sequences. (Running on oeis4.)