A089216 Number of triples (x,y,z) of integers such that 0 <= x <= y < n, 0 <= z < n, n^2 = x^2 + y^2 - z^2.
0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 2, 1, 3, 3, 2, 2, 5, 3, 5, 4, 4, 4, 7, 4, 7, 7, 6, 6, 10, 6, 9, 9, 9, 11, 10, 7, 12, 11, 12, 10, 16, 10, 16, 13, 11, 15, 18, 13, 18, 17, 17, 16, 23, 16, 17, 16, 18, 20, 24, 17, 26, 25, 21, 22, 24
Offset: 1
Keywords
Programs
-
Mathematica
r[n_] := Reduce[n^2 == x^2 + y^2 - z^2 && 0 <= x <= y < n && 0 <= z < n, {x, y, z}, Integers]; Reap[For[n = 1, n <= 100, n++, rn = r[n]; w = Which[rn === False, 0, Head[rn] === And, 1, Head[rn] === Or, Length[rn], True, -1; Print[n, " error"]]; Print[w]; Sow[w]]][[2, 1]] (* Jean-François Alcover, Jan 21 2016 *)
Extensions
More terms from Jean-François Alcover, Jan 21 2016
Comments