cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A074590 Number of primitive solutions to n = x^2 + y^2 + z^2 (i.e., with gcd(x,y,z) = 1).

This page as a plain text file.
%I A074590 #25 Jul 29 2017 23:51:13
%S A074590 1,6,12,8,0,24,24,0,0,24,24,24,0,24,48,0,0,48,24,24,0,48,24,0,0,24,72,
%T A074590 24,0,72,48,0,0,48,48,48,0,24,72,0,0,96,48,24,0,48,48,0,0,48,72,48,0,
%U A074590 72,72,0,0,48,24,72,0,72,96,0,0,96,96,24,0,96,48,0,0,48,120
%N A074590 Number of primitive solutions to n = x^2 + y^2 + z^2 (i.e., with gcd(x,y,z) = 1).
%D A074590 See A005875 for references.
%D A074590 E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 54.
%H A074590 T. D. Noe, <a href="/A074590/b074590.txt">Table of n, a(n) for n = 0..10000</a>
%H A074590 <a href="/index/Su#ssq">Index entries for sequences related to sums of squares</a>
%F A074590 n is representable as the sum of 3 squares if and only if n is not of the form 4^a (8k + 7) (cf. A000378).
%F A074590 A005875(n) = Sum_{d^2|n} a(n/d^2).
%F A074590 Let h = number of classes of primitive binary quadratic forms, corresponding to the discriminant D = -n if n = 3 (mod 8), D = -4n if n = 1, 2, 5, 6 (mod 8) and let d_1 = 1/2, d_3 = 1/3, d_n = 1 otherwise. Then a(n) = 12 h d_n, if n = 1, 2, 5, 6 (mod 8), 24 h d_n, if n = 3 (mod 8). (Grosswald)
%F A074590 Also, if n is squarefree and (r/n) is the Jacobi symbol, a(n) = 24 sum(r = 1, [n/4], (r/n)) if n = 1 (mod 4), 8 sum(r = 1, [n/2], (r/n)) if n = 3 (mod 8). (Grosswald)
%e A074590 G.f. = 1 + 6*x + 12*x^2 + 8*x^3 + 24*x^5 + 24*x^6 + 24*x^9 + 24*x^10 + 24*x^11 + ...
%t A074590 a[n_] := (r = Reduce[ GCD[x, y, z] == 1 && n == x^2 + y^2 + z^2, {x, y, z}, Integers]; If[ r === False, 0, Length[ {ToRules[r]} ] ] ); a[0] = 1; Table[ a[n], {n, 0, 100}] (* _Jean-François Alcover_, Jan 13 2012 *)
%t A074590 a[ n_] := If[ n < 1, Boole[n == 0], Length @ Select[ {x, y, z} /. FindInstance[ n == x^2 + y^2 + z^2, {x, y, z}, Integers, 10^9], 1 == GCD @@ # &]]; (* _Michael Somos_, May 21 2015 *)
%Y A074590 Cf. A005875 (all solutions).
%K A074590 nonn,easy,nice
%O A074590 0,2
%A A074590 _N. J. A. Sloane_, Dec 03 2002
%E A074590 More terms from _Vladeta Jovovic_, Dec 04 2002