A216512 Number of nonnegative integer solutions to the equation a^2 + 7*b^2 = n.
1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0
Offset: 1
Keywords
Links
- Aung Phone Maw, On the Number of Ways a Natural Number Can Be Written in the Form 7a^2+b^2, arXiv:2408.01763 [math.GM], 2024.
Crossrefs
Cf. A020670.
Programs
-
Mathematica
r[n_] := Reduce[x >= 0 && y >= 0 && x^2 + 7 y^2 == n, Integers]; a[n_] := Which[rn = r[n]; rn === False, 0, Head[rn] === And, 1, Head[rn] === Or, Length[rn], True, -1]; Table[a[n], {n, 1, 87}] (* Jean-François Alcover, Jun 24 2017 *)