A284211 a(n) is the least positive integer such that n^2 + a(n)^2 and n^2 + (a(n) + 2)^2 are primes.
2, 1, 8, 9, 2, 29, 8, 3, 14, 1, 4, 23, 8, 9, 2, 29, 8, 5, 14, 1, 44, 13, 18, 59, 4, 9, 20, 13, 4, 11, 4, 3, 188, 9, 16, 149, 28, 13, 44, 1, 44, 23, 8, 19, 14, 19, 8, 35, 4, 17, 14, 3, 10, 59, 4, 9, 50, 3, 24, 29, 24, 43, 38, 9, 2, 89, 18, 5, 194, 17, 14, 5
Offset: 1
Keywords
Examples
a(1)=2: 1^2 + 1^2 = 2 is a prime but 1 + (1 + 2)^2 = 10 is not, while 1^2 + 2^2 = 5 and 1^2 + (2+2)^2 = 17 are both primes.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000 (first 99 terms from Lars-Erik Svahn)
- Lars-Erik Svahn, numbertheory.4th
- Akshaa Vatwani, Bounded gaps between Gaussian primes, J. of Number Theory 171 (2017), 449-473.
Crossrefs
Cf. A069003.
Programs
-
Maple
f:= proc(n) local k,pp,p; pp:= false; for k from (n+1) mod 2 by 2 do p:= isprime(n^2 + k^2); if p and pp then return k-2 fi; pp:= p; od; end proc: map(f, [$1..100]); # Robert Israel, Mar 30 2017
-
Mathematica
a[n_] := Block[{k = Mod[n, 2] + 1}, While[! PrimeQ[n^2 + k^2] || ! PrimeQ[n^2 + (k + 2)^2], k += 2]; k]; Array[a, 72] (* Giovanni Resta, Mar 23 2017 *) lpi[n_]:=Module[{k=1},While[!AllTrue[n^2+{k^2,(k+2)^2},PrimeQ],k++];k]; Array[lpi,80] (* Harvey P. Dale, Aug 15 2024 *)
-
PARI
a(n) = my(k=n%2+1); while (!(isprime(n^2+k^2) && isprime(n^2+(k+2)^2)), k+=2); k \\ Michel Marcus, Mar 25 2017
Comments