OFFSET
1,1
COMMENTS
n is in the sequence iff 4*n is.
If a(n) is a prime number, a(n) mod 12 = 1.
Prime terms of sequence are listed in A068228 that lists generalized cuban primes (A007645) which are the sum of 2 nonzero squares.
Also positive numbers of the form x^2 - 3*y^2 (A084916) that are the sum of 2 nonzero squares. - Frank M Jackson, Oct 13 2019
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1) = 13 because 13 = 3^2 + 3*1 + 1^2 = 3^2 + 2^2.
a(2) = 25 because 25 = 5^2 + 5*0 + 0^2 = 4^2 + 3^2.
a(3) = 37 because 37 = 4^2 + 4*3 + 3^2 = 6^2 + 1^2.
MATHEMATICA
Select[Range@750, Length[PowersRepresentations[#, 2, 2] /. {0, _}->Nothing]>0 && Reduce[#==x^2+x*y+y^2, {x, y}, Integers]=!=False &] (* Frank M Jackson, Oct 13 2019 *)
PROG
(PARI) isok(n) = { for( i=1, #n=factor(n)~%4, n[1, i]==3 && n[2, i]%2 && return); n && ( vecmin(n[1, ])==1 || (n[1, 1]==2 && n[2, 1]%2))}
is(n) = #bnfisintnorm(bnfinit(z^2+z+1), n);
for(n=1, 1e3, if( is(n) && isok(n), print1(n, ", ")))
CROSSREFS
KEYWORD
nonn
AUTHOR
Altug Alkan, Nov 22 2015
STATUS
approved