OFFSET
1,4
COMMENTS
Table 2 of Fox and Parker lists a(n) for n=1 to 1000. - Michael Somos, Jul 13 2013
"Each O_1^{2+}(Z)-orbit has a representative (z, x, y) in Z^3 with z > x >= y >= 0 and z >= x+y" from proof of Corollary 2.4 of Fox and Parker. We are looking for solutions of n = z^2 - x^2 - y^2. - Michael Somos, Jul 13 2013
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
G. J. Fox, Letter to N. J. A. Sloane, May 1991
Glenn J. Fox and Phillip E. Parker, The Lorentzian modular group and nonlinear lattices, The mathematical heritage of C. F. Gauss, 282-303, World Sci. Publishing, River Edge, NJ, 1991.
Glenn J. Fox and Phillip E. Parker, The Lorentzian modular group and nonlinear lattices II, The mathematical heritage of C. F. Gauss, 282-303, World Sci. Publishing, River Edge, NJ, 1991.
EXAMPLE
x + x^2 + x^3 + 2*x^4 + x^5 + x^6 + 2*x^7 + 3*x^8 + 2*x^9 + x^10 + 3*x^11
+ ...
a(8) = 3 since orbits(8) = [[3, 1, 0], [4, 2, 2], [5, 4, 1]] where 8 = 3^2-1^2-0^2 = 4^2-2^2-2^2 = 5^2-4^2-1^2 for the three O_1^{2+}(Z)-orbit representatives. - Michael Somos, Jul 13 2013
MATHEMATICA
r[n_] := Reduce[z > x >= y >= 0 && z >= x + y && n == z^2 - x^2 - y^2, {x, y, z}, Integers]; a[n_] := Switch[rn = r[n]; Head[rn], And, 1, Or, Length[rn]]; Table[Print["a(", n, ") = ", an = a[n], " ", {x, y, z} /. {ToRules[rn]}]; an, {n, 1, 105}]
(* or, from 1st PARI script: *) a[n_] := Sum[If[Mod[n - i, 2] != 0, 0, DivisorSum[j = (n + i*i)/2, Boole[# >= i && #^2 <= j] &]], {i, 0, Sqrt[n] }]; Array[a, 105] (* Jean-François Alcover, Dec 02 2015 *)
PROG
(PARI) {a(n) = my(j); if( n<1, 0, sum( i=0, sqrtint(n), if( (n-i)%2, 0, sumdiv( j = (n + i*i) / 2, d, d>=i && d*d <= j))))} /* Michael Somos, Feb 14 2002 */
(PARI) {orbits(n) = local(j, v=[]); if( n<1, 0, forstep( i=n%2, sqrtint(n), 2, fordiv( j = (n + i*i) / 2, d, if( d>=i && d*d <= j, v = concat( [[d+j/d-i, j/d-i, d-i]], v)))); vecsort(v))} /* Michael Somos, Jul 13 2013 */
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Michael Somos, Feb 14 2002
STATUS
approved