A069003 Smallest integer d such that n^2 + d^2 is a prime number.
1, 1, 2, 1, 2, 1, 2, 3, 4, 1, 4, 7, 2, 1, 2, 1, 2, 5, 6, 1, 4, 5, 8, 1, 4, 1, 2, 5, 4, 11, 4, 3, 2, 5, 2, 1, 2, 3, 10, 1, 4, 5, 8, 9, 2, 5, 2, 13, 4, 7, 4, 3, 10, 1, 4, 1, 2, 3, 6, 13, 10, 3, 32, 9, 2, 1, 2, 5, 10, 3, 6, 5, 2, 1, 4, 5, 10, 7, 4, 7, 4, 3, 18, 1, 2, 9, 2, 3, 4, 1, 4, 7, 8, 1, 2, 5, 2, 3, 4, 3
Offset: 1
Examples
a(5)=2 because 2 is the smallest integer d such that 5^2+d^2 is a prime number.
References
- W. Sierpinski, Elementary Theory of Numbers, 2nd English edition, revised and enlarged by A. Schinzel, Elsevier, 1988.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000 (first 1000 terms from T. D. Noe)
- Eric Weisstein's World of Mathematics, Gaussian Prime.
- Wikipedia, Schinzel's Hypothesis H.
Crossrefs
Programs
-
Maple
f:= proc(n) local d; for d from 1+(n mod 2) by 2 do if isprime(n^2+d^2) then return d fi od end proc: f(1):= 1: map(f, [$1..1000]); # Robert Israel, Jul 06 2015
-
Mathematica
imP4P[n_] := Module[{k = 1}, While[Not[PrimeQ[n^2 + k^2]], k++]; k]; Table[imP4P[n], {n, 50}] (* Alonso del Arte, Feb 07 2011 *)
-
PARI
a(n)=my(k);while(!isprime(n^2+k++^2),);k \\ Charles R Greathouse IV, Mar 20 2013
Comments