The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A000164 Number of partitions of n into 3 squares (allowing part zero). 28
 1, 1, 1, 1, 1, 1, 1, 0, 1, 2, 1, 1, 1, 1, 1, 0, 1, 2, 2, 1, 1, 1, 1, 0, 1, 2, 2, 2, 0, 2, 1, 0, 1, 2, 2, 1, 2, 1, 2, 0, 1, 3, 1, 1, 1, 2, 1, 0, 1, 2, 3, 2, 1, 2, 3, 0, 1, 2, 1, 2, 0, 2, 2, 0, 1, 3, 3, 1, 2, 2, 1, 0, 2, 2, 3, 2, 1, 2, 1, 0, 1, 4, 2, 2, 1, 2, 3, 0, 1, 4, 3, 1, 0, 1, 2, 0, 1, 2, 3, 3, 2, 4, 2, 0, 2 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,10 COMMENTS a(n) = number of triples of integers [ i, j, k] such that i >= j >= k >= 0 and n = i^2 + j^2 + k^2. - Michael Somos, Jun 05 2012 REFERENCES E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 84. LINKS T. D. Noe, Table of n, a(n) for n = 0..10000 Hirschhorn, M. D., Some formulas for partitions into squares, Discrete Math. 211 (2000), pp. 225-228. FORMULA Let e(n,r,s,m) be the excess of the number of n's r(mod m) divisors over the number of its s(mod m) divisors, and let delta(n)=1 if n is a perfect square and 0 otherwise. Then, if we define alpha(n)=5delta(n)+3 delta(1/2 n)+ 4delta(1/3 n), beta(n)=4e(n,1,3,4)+3e(n,1,7,8)+3e(n,3,5,8), gamma(n)=2 sum(e(n-k^2,1,3,4),1<=k^2 n then             return a;         end if;         for y from x do             if x^2+2*y^2 > n then                 break;             end if;             z2 := n-x^2-y^2 ;             if issqr(z2) then                 z := sqrt(z2) ;                 if z >= y then                     a := a+1 ;                 end if;             end if;         end do:     end do:     a; end proc: # R. J. Mathar, Feb 12 2017 MATHEMATICA Length[PowersRepresentations[ #, 3, 2]] & /@ Range[0, 104] e[0, r_, s_, m_]=0; e[n_, r_, s_, m_]:=Length[Select[Divisors[n], Mod[ #, m]==r &]]-Length[Select[Divisors[n], Mod[ #, m]==s &]]; alpha[n_]:=5delta[n]+3delta[1/2 n]+4delta[1/3n]; beta[n_]:=4e[n, 1, 3, 4]+3e[n, 1, 7, 8]+3e[n, 3, 5, 8]; delta[n_]:=If[IntegerQ[Sqrt[n]], 1, 0]; f[n_]:=Table[n-k^2, {k, 1, Floor[Sqrt[n]]}]; gamma[n_]:=2 Plus@@(e[ #, 1, 3, 4] &/@f[n]); p3[n_]:=1/12(alpha[n]+beta[n]+gamma[n]); p3[ # ] &/@Range[0, 104] (* Ant King, Oct 15 2010 *) a[ n_] := If[ n < 0, 0, Sum[ Boole[ n == i^2 + j^2 + k^2], {i, 0, Sqrt[n]}, {j, 0, i}, {k, 0, j}]]; (* Michael Somos, Aug 15 2015 *) PROG (PARI) {a(n) = if( n<0, 0, sum( i=0, sqrtint(n), sum( j=0, i, sum( k=0, j, n == i^2 + j^2 + k^2))))}; /* Michael Somos, Jun 05 2012 */ (Python) import collections; a = collections.Counter(i*i + j*j + k*k for i in range(100) for j in range(i+1) for k in range(j+1)) # David Radcliffe, Apr 15 2019 CROSSREFS Equivalent sequences for other numbers of squares: A000161 (2), A002635 (4), A000174 (5). Cf. A004215 (positions of zeros), A094942 (positions of ones), A124966 (positions of greater values). Cf. A005875, A016727. Sequence in context: A178666 A206706 A302354 * A330261 A157746 A349082 Adjacent sequences:  A000161 A000162 A000163 * A000165 A000166 A000167 KEYWORD nonn AUTHOR EXTENSIONS Name clarified by Wolfdieter Lang, Apr 08 2013 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified November 30 20:17 EST 2021. Contains 349425 sequences. (Running on oeis4.)