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.

A016725 Number of integer solutions to x^2+y^2+z^2 = n^2, allowing zeros and distinguishing signs and order.

Original entry on oeis.org

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
Offset: 0

Views

Author

csvcjld(AT)nomvst.lsumc.edu

Keywords

Comments

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

Examples

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

Crossrefs

Cf. A005875.
Column k=3 of A302996.

Programs

  • 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]
  • 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 */

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

Extensions

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