A374276 Number of representations of n by the quadratic form x^2 + 3*x*y + y^2 with 0 <= x <= y.
1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2
Offset: 0
Keywords
Examples
121 = 0^2 + 3*0*11 + 11^2 = 3^2 + 3*3*7 + 7^2. So a(121) = 2.
Programs
-
Mathematica
a[n_]:=Module[{m=Floor[Sqrt[n]]},Sum[Sum[Boole[i^2+3i*j+j^2==n],{j,i,m}],{i,0,m}]]; Array[a,122,0] (* Stefano Spezia, Jul 02 2024 *)
-
PARI
a(n) = my(m=sqrtint(n)); sum(i=0, m, sum(j=i, m, i^2+3*i*j+j^2==n));
Formula
a(A031363(n)) > 0.