OFFSET
1,1
COMMENTS
Sequence focuses on the positive values of x and y. Otherwise, for example 17 = 4^2 + (-1)^2 and 4^2 + 4*(-1) + (-1)^2 = 13 is prime too.
Corresponding generalized cuban primes are 3, 7, 19, 43, 61, 67, 97, 139, 181, 199, 211, 223, 271, 277, 337, 421, 439, 499, 541, 601, 619, 631, 751, 787, 811, 823, 829, 919, ...
EXAMPLE
5 is a term because 2^2 + 1^2 = 5 is prime and 2^2 + 2*1 + 1^2 = 7 is prime.
13 is a term because 3^2 + 2^2 = 13 is prime and 3^2 + 3*2 + 2^2 = 19 is prime.
37 is a term because 6^2 + 1^2 = 37 is prime and 6^2 + 6*1 + 1^2 = 43 is prime.
MATHEMATICA
lim = 50; Take[Select[Union@ Flatten@ Table[ If[PrimeQ[Abs[x^2 + x y + y^2]], x^2 + y^2, Nothing], {x, lim}, {y, lim}], PrimeQ], 53] (* Michael De Vlieger, Jan 07 2016 *)
PROG
(PARI) list(lim) = my(v=List(), t); lim\=1; for(x=1, sqrtint(lim), for(y=1, min(sqrtint(lim-x^2), x), if(isprime(t=x^2+y^2) && isprime(x^2+x*y+y^2), listput(v, t)))); vecsort(Vec(v), , 8)
CROSSREFS
KEYWORD
nonn
AUTHOR
Altug Alkan, Jan 07 2016
STATUS
approved