login
Number of positive integer solutions to the equation a^2 + 7*b^2 = n.
4

%I #16 Feb 16 2024 06:32:33

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

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

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

%N Number of positive integer solutions to the equation a^2 + 7*b^2 = n.

%t r[n_] := Reduce[x > 0 && y > 0 && x^2 + 7 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, 1, 87}] (* _Jean-François Alcover_, Jun 24 2017 *)

%Y Cf. A155717.

%K nonn

%O 1,32

%A _V. Raman_, Sep 08 2012