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.

Showing 1-4 of 4 results.

A290081 a(n) = number of ways of writing n as the sum of two odd positive squares.

Original entry on oeis.org

0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2
Offset: 0

Views

Author

Antti Karttunen, Jul 24 2017

Keywords

Examples

			a(2) = 1 as 2 = 1 + 1.
a(10) = 2 as 10 = 1 + 9 = 9 + 1.
a(50) = 3 as 50 = 1 + 49 = 49 + 1 = 25 + 25.
		

Crossrefs

Bisections: A000004, A008442.

Programs

  • PARI
    upto(n) = {my(m, v, res = vector(n)); m = (sqrtint(n)+1)\2; v = vector(m, i, (2*i-1)^2); forvec(x = vector(2, i, [1, #v]), s = v[x[1]] + v[x[2]]; if(s <= n, res[s]+=(1+(x[1]!=x[2]))), 1);concat(0, res)}  \\ David A. Corneth, Jul 24 2017
    
  • PARI
    A008442(n) = if( n<1 || n%4!=1, 0, sumdiv(n, d, (d%4==1) - (d%4==3))); \\ This function from Michael Somos, Apr 24 2004
    A290081(n) = if(n%2,0,A008442(n/2));
    
  • Python
    from sympy import divisors
    def A290081(n): return 0 if n&1 else 0 if (m:=n>>1)&3!=1 else sum(((a:=d&3)==1)-(a==3) for d in divisors(m,generator=True)) # Chai Wah Wu, May 17 2023
  • Scheme
    (define (A290081 n) (cond ((< n 2) 0) ((odd? n) 0) (else (let loop ((k (- (A000196 n) (modulo (+ 1 (A000196 n)) 2))) (s 0)) (if (< k 1) s (loop (- k 2) (+ s (A010052 (- n (* k k))))))))))
    

Formula

a(2n) = A008442(n), a(2n+1) = 0.

A085121 Number of ways of writing n as the sum of three odd squares.

Original entry on oeis.org

0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 72
Offset: 0

Views

Author

N. J. A. Sloane, Apr 25 2004

Keywords

Comments

Number of ways of writing n as the sum of the squares of three odd numbers (see example). Equals 8*A008437 because each summand can be the square of either a positive or negative odd number, and there are three summands, thus 2^3 = 8. - Antti Karttunen & Michel Marcus, Jul 23 2018

Examples

			a(3) = 8 because 3 = (+1)^2 + (+1)^2 + (+1)^2 = (-1)^2 + (+1)^2 + (+1)^2 = (+1)^2 + (-1)^2 + (+1)^2 = (+1)^2 + (+1)^2 + (-1)^2 = (-1)^2 + (-1)^2 + (+1)^2 = (-1)^2 + (+1)^2 + (-1)^2 = (+1)^2 + (-1)^2 + (-1)^2 = (-1)^2 + (-1)^2 + (-1)^2. - _Antti Karttunen_, Jul 23 2018
		

Crossrefs

Cf. A005875, A008437. The nonzero coefficients give A005878.

Programs

Formula

G.f.: (Sum_{n=-oo..oo} q^((2n+1)^2))^3.

A349610 Number of solutions to x^2 + y^2 + z^2 <= n^2, where x, y, z are positive odd integers.

Original entry on oeis.org

0, 0, 1, 1, 4, 7, 17, 20, 35, 45, 69, 84, 114, 136, 184, 217, 272, 314, 389, 443, 528, 597, 702, 784, 901, 1018, 1166, 1268, 1442, 1589, 1791, 1926, 2157, 2332, 2584, 2800, 3058, 3293, 3596, 3872, 4194, 4485, 4878, 5184, 5590, 5950, 6388, 6761, 7232
Offset: 0

Views

Author

Ilya Gutkovskiy, Nov 23 2021

Keywords

Examples

			a(4) = 4 since there are solutions (1,1,1), (3,1,1), (1,3,1), (1,1,3).
		

Crossrefs

Programs

  • Mathematica
    Table[SeriesCoefficient[EllipticTheta[2, 0, x^4]^3/(8 (1 - x)), {x, 0, n^2}], {n, 0, 48}]

Formula

a(n) = [x^(n^2)] theta_2(x^4)^3 / (8 * (1 - x)).
a(n) = Sum_{k=0..n^2} A008437(k).
a(n) = A053596(n) / 8.

A372512 Number of solutions to x^2 + y^2 + z^2 <= n, where x, y, z are positive odd integers.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 7, 7, 7, 7, 7, 7, 7, 7, 11, 11, 11, 11, 11, 11, 11, 11, 17, 17, 17, 17, 17, 17, 17, 17, 20, 20, 20, 20, 20, 20, 20, 20, 26, 26, 26, 26, 26, 26, 26, 26, 35, 35, 35, 35, 35, 35, 35, 35, 38, 38, 38, 38, 38, 38, 38, 38, 45, 45, 45, 45, 45, 45
Offset: 0

Views

Author

Ilya Gutkovskiy, May 04 2024

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 80; CoefficientList[Series[EllipticTheta[2, 0, x^4]^3/(8 (1 - x)), {x, 0, nmax}], x]
Showing 1-4 of 4 results.