OFFSET
1,2
COMMENTS
Discriminant -108.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
N. J. A. Sloane et al., Binary Quadratic Forms and OEIS (Index to related sequences, programs, references)
Naoki Uchida, Integers of the Form ax^2 + bxy + cy^2, arXiv:2001.11632 [math.NT], 2020.
MATHEMATICA
Select[Range[0, 300], Resolve@Exists[{x, y}, Reduce[# == (4 x^2 + 2 x y + 7 y^2), {x, y}, Integers]] &] (* Vincenzo Librandi, Feb 11 2020 *)
PROG
(PARI) is(n)=my(h2=valuation(n, 2), h3=valuation(n, 3), f=factor(n>>h2/3^h3), s); if(h2==0 && h3==0, s=1, if(h2%2||h3==1, return(0)); s=0); for(i=1, #f~, if(f[i, 1]%3==1, if(s && !ispower(Mod(2, f[i, 1]), 3), s=0), f[i, 2]%2, return(0))); s==0
(PARI) list(lim)=my(v=List(), t); lim\=1; for(x=0, sqrtint(lim\4), t=4*x^2; for(y=(-x-sqrtint(7*lim-27*x^2))\7, (1-x+sqrtint(7*lim-27*x^2))\7, listput(v, t+2*x*y+7*y^2))); select(n->n<=lim, Set(v))
CROSSREFS
KEYWORD
nonn
AUTHOR
Charles R Greathouse IV, Feb 10 2020
STATUS
approved