login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A016725 Number of integer solutions to x^2+y^2+z^2 = n^2, allowing zeros and distinguishing signs and order. 7
1, 6, 6, 30, 6, 30, 30, 54, 6, 102, 30, 78, 30, 78, 54, 150, 6, 102, 102, 126, 30, 270, 78, 150, 30, 150, 78, 318, 54, 174, 150, 198, 6, 390, 102, 270, 102, 222, 126, 390, 30, 246, 270, 270, 78, 510, 150, 294, 30, 390, 150, 510, 78, 318, 318, 390, 54, 630, 174, 366 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

COMMENTS

Hurwitz found a formula for a(n). See the paper by Olds.

LINKS

T. D. Noe, Table of n, a(n) for n = 0..10000

Michael Gilleland, Some Self-Similar Integer Sequences

Werner Hürlimann, Exact and Asymptotic Evaluation of the Number of Distinct Primitive Cuboids, Journal of Integer Sequences, Vol. 18 (2015), Article 15.2.5.

Jean Lagrange, Décomposition d'un entier en somme de carrés et fonction multiplicative, Séminaire Delange-Pisot-Poitou. Théorie des nombres, 14 no. 1 (1972-1973), Exp. No. 1, 5 p.

C. D. Olds, On the representations, N_3(n^2), Bull. Amer. Math. Soc. 47 (1941), 499-503.

Eric Weisstein's World of Mathematics, Sum of Squares Function

FORMULA

a(n) = 6 * b(n) if n>0 where b(n) is multiplicative with b(2^e) = 1, b(p^e) = p^e if p == 1 (mod 4), b(p^e) = p^e + 2 * (p^e - 1) / (p - 1) if p == 3 (mod 4). - Michael Somos, Nov 18 2011

a(n) = A005875(n^2).

a(n) = [x^(n^2)] theta_3(x)^3, where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 20 2018

EXAMPLE

1 + 6*x + 6*x^2 + 30*x^3 + 6*x^4 + 30*x^5 + 30*x^6 + 54*x^7 + 6*x^8 + ...

MAPLE

for n from 0 to 60 do s:=0: for x from -n to n do for y from -n to n do for z from -n to n do if (x^2+y^2+z^2) = n^2 then s:=s+1 fi od od od: printf("%d, ", s) od: # C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 13 2004

MATHEMATICA

SquaresR[3, Range[0, 100]^2]

PROG

(PARI) {a(n) = if( n<1, n==0, polcoeff( sum( k=1, n, 2 * x^k^2, 1 + x * O(x^n^2))^3, n^2))} /* Michael Somos, Nov 18 2011 */

(PARI) {a(n) = local(A, p, e); if( n<1, n==0, A = factor(n); 6 * prod( k=1, matsize(A)[1], if( p = A[k, 1], e = A[k, 2]; if( p==2, 1, p^e + if( p%4 == 1, 0, 2 * (p^e - 1) / (p - 1))))))} /* Michael Somos, Nov 18 2011 */

CROSSREFS

Cf. A005875.

Sequence in context: A243122 A274940 A253066 * A267651 A151779 A255462

Adjacent sequences:  A016722 A016723 A016724 * A016726 A016727 A016728

KEYWORD

nonn

AUTHOR

csvcjld(AT)nomvst.lsumc.edu

EXTENSIONS

Revised description from C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 13 2004

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 | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 21 05:14 EST 2018. Contains 317428 sequences. (Running on oeis4.)