A107628 Number of integral quadratic forms ax^2 + bxy + cy^2 whose discriminant b^2-4ac is -n, 0 <= b <= a <= c and gcd(a,b,c) = 1.
0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 2, 1, 0, 0, 1, 2, 0, 0, 2, 2, 0, 0, 1, 1, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 3, 2, 0, 0, 1, 2, 0, 0, 3, 2, 0, 0, 2, 2, 0, 0, 3, 3, 0, 0, 2, 2, 0, 0, 3, 2, 0, 0, 1, 3, 0, 0, 4, 2, 0, 0, 2, 2, 0, 0, 3, 3, 0, 0, 2, 4, 0, 0, 4, 2, 0, 0, 2, 2, 0, 0, 5, 4, 0, 0, 2, 2, 0, 0, 3, 4, 0
Offset: 1
Keywords
Examples
a(15)=2 because the forms x^2 + xy + 4y^2 and 2x^2 + xy + 2y^2 have discriminant -15.
References
- See A106856.
Links
- T. D. Noe, Table of n, a(n) for n=1..10000
Crossrefs
Programs
-
Mathematica
dLim=150; cnt=Table[0, {dLim}]; nn=Ceiling[dLim/4]; Do[d=b^2-4a*c; If[GCD[a, b, c]==1 && 0<-d<=dLim, cnt[[ -d]]++ ], {b, 0, nn}, {a, b, nn}, {c, a, nn}]; cnt
-
PARI
{a(n)=local(m); if(n<3, 0, forvec(v=vector(3,k,[0,(n+1)\4]), if( (gcd(v)==1)&(-v[1]^2+4*v[2]*v[3]==n), m++ ), 1); m)} /* Michael Somos, May 31 2005 */
Comments