login
Number of nonnegative integer solutions to the equation x^2 + 6*y^2 = n.
0

%I #15 Jun 24 2017 12:11:45

%S 1,1,0,0,1,0,1,1,0,1,1,0,0,0,0,1,1,0,0,0,0,0,1,0,1,2,0,0,1,0,0,1,0,1,

%T 0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,2,0,0,0,0,1,2,0,0,1,0,1,0,0,1,1,0,0,0,

%U 0,0,2,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,1,0,1,0,0,0,0,0,1,1,0,0

%N Number of nonnegative integer solutions to the equation x^2 + 6*y^2 = n.

%t r[n_] := Reduce[x >= 0 && y >= 0 && x^2 + 6 y^2 == n, Integers];

%t a[n_] := Which[rn = r[n]; rn === False, 0, Head[rn] === And, 1, Head[rn] === Or, Length[rn], True, -1];

%t Table[a[n], {n, 0, 99}] (* _Jean-François Alcover_, Jun 24 2017 *)

%Y Cf. A002481.

%K nonn

%O 0,26

%A _V. Raman_, Sep 08 2012

%E Verified by _N. J. A. Sloane_, Sep 10 2012

%E a(96) and a(97) corrected by _Jean-François Alcover_, Jun 24 2017