OFFSET
1,1
COMMENTS
All terms are squarefree, since primes p and q must be distinct. (Otherwise, we would have (p+q)^2 - s = (2p)^2 - p^2 = 3p^2, which could not be prime.) - Jon E. Schoenfield, Dec 16 2016
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
EXAMPLE
The terms 6, 14, 21 and 581543 are in the sequence because:
2^2 + 2*3 + 3^2 = (2+3)^2 - 6 = 19 is prime.
2^2 + 2*7 + 7^2 = (2+7)^2 - 14 = 67 is prime.
3^2 + 3*7 + 7^2 = (3+7)^2 - 21 = 79 is prime.
677^2 + 677*859 + 859^2 = (677+859)^2 - 581543 = 1777753 is prime.
MATHEMATICA
max = 1000; Reap[For[p=2, p <= Sqrt[max], p = NextPrime[p], For[q=NextPrime[p], p*q <= max, q=NextPrime[q], If[PrimeQ[(p+q)^2-p*q], Sow[p*q]]]]][[2, 1]] // Sort (* Jean-François Alcover, Dec 09 2014 *)
Select[Select[Range[10^3], SquareFreeQ@ # && PrimeOmega@ # == 2 &],
Function[s, PrimeQ[(#1 + #2)^2 - s] & @@ FactorInteger[s][[All, 1]]]] (* Michael De Vlieger, Dec 17 2016 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Jun 21 2014
STATUS
approved