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-8 of 8 results.

A302998 Square array A(n,k), n >= 0, k >= 0, read by antidiagonals: A(n,k) = [x^(n^2)] (1 + theta_3(x))^k/(2^k*(1 - x)), where theta_3() is the Jacobi theta function.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, 1, 5, 11, 11, 5, 1, 1, 6, 20, 29, 17, 6, 1, 1, 7, 36, 70, 54, 26, 7, 1, 1, 8, 63, 157, 165, 99, 35, 8, 1, 1, 9, 106, 337, 482, 357, 163, 45, 9, 1, 1, 10, 171, 702, 1319, 1203, 688, 239, 58, 10, 1, 1, 11, 265, 1420, 3390, 3819, 2673, 1154, 344, 73, 11, 1
Offset: 0

Views

Author

Ilya Gutkovskiy, Apr 17 2018

Keywords

Comments

A(n,k) is the number of nonnegative solutions to (x_1)^2 + (x_2)^2 + ... + (x_k)^2 <= n^2.

Examples

			Square array begins:
  1,  1,   1,   1,    1,     1,  ...
  1,  2,   3,   4,    5,     6,  ...
  1,  3,   6,  11,   20,    36,  ...
  1,  4,  11,  29,   70,   157,  ...
  1,  5,  17,  54,  165,   482,  ...
  1,  6,  26,  99,  357,  1203,  ...
		

Crossrefs

Programs

  • Mathematica
    Table[Function[k, SeriesCoefficient[(1 + EllipticTheta[3, 0, x])^k/(2^k (1 - x)), {x, 0, n^2}]][j - n], {j, 0, 11}, {n, 0, j}] // Flatten
    Table[Function[k, SeriesCoefficient[1/(1 - x) Sum[x^i^2, {i, 0, n}]^k, {x, 0, n^2}]][j - n], {j, 0, 11}, {n, 0, j}] // Flatten
  • PARI
    T(n,k)={if(k==0, 1, polcoef(((sum(j=0, n, x^(j^2)) + O(x*x^(n^2)))^k)/(1-x), n^2))} \\ Andrew Howroyd, Sep 14 2019

Formula

A(n,k) = [x^(n^2)] (1/(1 - x))*(Sum_{j>=0} x^(j^2))^k.

A302997 Square array A(n,k), n >= 0, k >= 0, read by antidiagonals: A(n,k) = [x^(n^2)] theta_3(x)^k/(1 - x), where theta_3() is the Jacobi theta function.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 5, 5, 1, 1, 7, 13, 7, 1, 1, 9, 33, 29, 9, 1, 1, 11, 89, 123, 49, 11, 1, 1, 13, 221, 425, 257, 81, 13, 1, 1, 15, 485, 1343, 1281, 515, 113, 15, 1, 1, 17, 953, 4197, 5913, 3121, 925, 149, 17, 1, 1, 19, 1713, 12435, 23793, 16875, 6577, 1419, 197, 19, 1, 1, 21, 2869, 33809, 88273, 84769, 42205, 11833, 2109, 253, 21, 1
Offset: 0

Views

Author

Ilya Gutkovskiy, Apr 17 2018

Keywords

Comments

A(n,k) is the number of integer lattice points inside the k-dimensional hypersphere of radius n.

Examples

			Square array begins:
  1,   1,   1,    1,     1,      1,  ...
  1,   3,   5,    7,     9,     11,  ...
  1,   5,  13,   33,    89,    221,  ...
  1,   7,  29,  123,   425,   1343,  ...
  1,   9,  49,  257,  1281,   5913,  ...
  1,  11,  81,  515,  3121,  16875,  ...
		

Crossrefs

Programs

  • Mathematica
    Table[Function[k, SeriesCoefficient[EllipticTheta[3, 0, x]^k/(1 - x), {x, 0, n^2}]][j - n], {j, 0, 11}, {n, 0, j}] // Flatten
    Table[Function[k, SeriesCoefficient[1/(1 - x) Sum[x^i^2, {i, -n, n}]^k, {x, 0, n^2}]][j - n], {j, 0, 11}, {n, 0, j}] // Flatten
  • PARI
    T(n,k)={if(k==0, 1, polcoef(((1 + 2*sum(j=1, n, x^(j^2)) + O(x*x^(n^2)))^k)/(1-x), n^2))} \\ Andrew Howroyd, Sep 14 2019

Formula

A(n,k) = [x^(n^2)] (1/(1 - x))*(Sum_{j=-infinity..infinity} x^(j^2))^k.

A232173 Number of ways of writing n^2 as a sum of n squares.

Original entry on oeis.org

1, 2, 4, 30, 24, 1210, 18396, 235998, 4793456, 76168850, 1282320348, 25100418046, 481341997032, 10452086347274, 237925595533164, 5524220670435982, 136705837928870368, 3444192369181374754, 89772662325079950436, 2431910317560215089758, 67517711482300160612104
Offset: 0

Views

Author

Paul D. Hanna, Nov 19 2013

Keywords

Examples

			There are a(4) = 24 solutions (w,x,y,z) of 4^2 = w^2 + x^2 + y^2 + z^2:
(2,2,2,2), (-2,-2,-2,-2), 6 permutations of (2,2,-2,-2),
4 permutations of (2,2,2,-2), 4 permutations of (2,-2,-2,-2),
4 permutations of (4,0,0,0), and 4 permutations of (-4,0,0,0).
To illustrate a(n) = the coefficient of x^(n^2) in theta_3(x)^n, where
theta_3(x) = 1 + 2*x + 2*x^4 + 2*x^9 + 2*x^16 + 2*x^25 + 2*x^36 + 2*x^49 +...,
form a table of coefficients of x^k in theta_3(x)^n, n>=0, like so:
n\k:0..1...2...3...4...5...6...7...8...9..10..11..12..13..14..15..16....
0:[(1),0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,...];
1: [1,(2), 0,  0,  2,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  0,  2,...];
2: [1, 4,  4,  0, (4), 8,  0,  0,  4,  4,  8,  0,  0,  8,  0,  0,  4,...];
3: [1, 6, 12,  8,  6, 24, 24,  0, 12,(30),24, 24,  8, 24, 48,  0,  6,...];
4: [1, 8, 24, 32, 24, 48, 96, 64, 24,104,144, 96, 96,112,192,192,(24),...];
5: [1,10, 40, 80, 90,112,240,320,200,250,560,560,400,560,800,960,730,...];
then the coefficients in parenthesis form the initial terms of this sequence.
		

Crossrefs

Cf. A066535.
Main diagonal of A302996.

Programs

  • Maple
    b:= proc(n, t) option remember; `if`(n=0, 1, `if`(n<0 or t<1, 0,
          b(n, t-1) +2*add(b(n-j^2, t-1), j=1..isqrt(n))))
        end:
    a:= n-> b(n^2, n):
    seq(a(n), n=0..20);  # Alois P. Heinz, Mar 10 2023
  • Mathematica
    b[n_, t_] := b[n, t] = If[n == 0, 1, If[n < 0 || t < 1, 0, b[n, t - 1] + 2*Sum[b[n - j^2, t - 1], {j, 1, Floor@Sqrt[n]}]]];
    a[n_] := b[n^2, n];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Aug 28 2023, after Alois P. Heinz *)
  • PARI
    {a(n)=local(THETA3=1+2*sum(m=1, n+1, x^(m^2))+x*O(x^(n^2))); polcoeff(THETA3^n, n^2)}
    for(n=0, 30, print1(a(n), ", "))

Formula

a(n) equals the coefficient of x^(n^2) in the n-th power of Jacobi theta_3(x) where theta_3(x) = 1 + 2*Sum_{n>=1} x^(n^2).

A255212 Number A(n,k) of partitions of n^2 into at most k square parts; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 2, 2, 1, 1, 0, 1, 1, 2, 2, 1, 2, 1, 0, 1, 1, 2, 2, 2, 2, 1, 1, 0, 1, 1, 2, 3, 3, 3, 2, 1, 1, 0, 1, 1, 2, 3, 3, 4, 4, 2, 1, 1, 0, 1, 1, 2, 3, 4, 5, 5, 4, 1, 1, 1, 0, 1, 1, 2, 4, 5, 7, 9, 6, 2, 4, 2, 1, 0
Offset: 0

Views

Author

Alois P. Heinz, Feb 17 2015

Keywords

Examples

			Square array A(n,k) begins:
  1, 1, 1, 1, 1,  1,  1,  1,  1,  1,  1, ...
  0, 1, 1, 1, 1,  1,  1,  1,  1,  1,  1, ...
  0, 1, 1, 1, 2,  2,  2,  2,  2,  2,  2, ...
  0, 1, 1, 2, 2,  2,  3,  3,  3,  4,  4, ...
  0, 1, 1, 1, 2,  3,  3,  4,  5,  5,  6, ...
  0, 1, 2, 2, 3,  4,  5,  7,  8,  9, 11, ...
  0, 1, 1, 2, 4,  5,  9, 10, 11, 15, 17, ...
  0, 1, 1, 2, 4,  6,  9, 13, 18, 21, 27, ...
  0, 1, 1, 1, 2,  7,  9, 16, 25, 30, 41, ...
  0, 1, 1, 4, 6,  8, 18, 27, 36, 52, 68, ...
  0, 1, 2, 2, 7, 13, 23, 36, 51, 70, 94, ...
		

Crossrefs

Main diagonal gives A105152.
Cf. A302996.

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0 or i=1 and n<=t, 1,
          (j-> `if`(t*jn, 0, b(n-j, i, t-1))))(i^2))
        end:
    A:= (n, k)-> b(n^2, n, k):
    seq(seq(A(n, d-n), n=0..d), d=0..15);
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0 || i == 1 && n <= t, 1, Function[j, If[t*jn, 0, b[n-j, i, t-1]]]][i^2]]; A[n_, k_] := b[n^2, n, k]; Table[Table[A[n, d - n], {n, 0, d}], {d, 0, 15}] // Flatten (* Jean-François Alcover, Feb 22 2016, after Alois P. Heinz *)

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

A267326 Number of ways writing n^2 as a sum of four squares: a(n) = A000118(n^2).

Original entry on oeis.org

1, 8, 24, 104, 24, 248, 312, 456, 24, 968, 744, 1064, 312, 1464, 1368, 3224, 24, 2456, 2904, 3048, 744, 5928, 3192, 4424, 312, 6248, 4392, 8744, 1368, 6968, 9672, 7944, 24, 13832, 7368, 14136, 2904, 11256, 9144, 19032, 744, 13784, 17784, 15144, 3192
Offset: 0

Views

Author

Christopher Heiling, Jan 13 2016

Keywords

Comments

For all pair of relatively prime numbers k, m this sequence is multiplicative with a factor of 8: a(k*m) = 8*a(k)*a(m). - Christopher Heiling, Apr 02 2017

Examples

			For n = 2 the a(n) = 24 solutions of x^2 + y^2 + z^2 + t^2 = 2^2 are:
{x,y,z,t} = {{0,0,0,2};{0,0,0,-2};{0,0,2,0};{0,0,-2,0};{0,2,0,0};{0,-2,0,0};{2,0,0,0};{-2,0,0,0};{1,1,1,1};{1,1,1,-1};{1,1,-1,1};{1,-1,1,1};{-1,1,1,1};{1,1,-1,-1};{1,-1,1,-1};{-1,1,1,-1};{1,-1,-1,1};{-1,1,-1,1};{1,-1,-1,-1};{-1,1,-1,-1};{-1,-1,1,-1};{-1,-1,1,-1};{-1,-1,-1,1};{-1,-1,-1,-1}}.
		

Crossrefs

Cf. A000118.
Partial sums of this sequence give A264390.
Column k=4 of A302996.

Programs

  • Maple
    terms := 42:
    (add(q^(m^2), m = -terms..terms))^4:
    seq(coeff(%, q, n^2), n = 0..terms); # Peter Bala, Jan 15 2016
  • Mathematica
    a[n_] := SquaresR[4, n^2];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, May 18 2023 *)

Formula

a(n) = A264390(n) - A264390(n-1) for n > 1 and a(1) = A264390(1) = 2*D.
a(n) = 8*sigma(n^2) if n is odd else 24*sigma(m(n^2)), where sigma(n) = A000203(n) and m(n) = A000265(n) is the largest odd divisor of n. - Peter Bala, Jan 15 2016
a(p^(k+1)) = 8*(p^2 *a(p^k)+p+1) for p prime. In particular a(p) = 8*(p^2+p+1). - Christopher Heiling, Apr 02 2017

Extensions

a(0)=1 prepended by Alois P. Heinz, Mar 10 2023

A361695 Number of ways of writing n^2 as a sum of seven squares.

Original entry on oeis.org

1, 14, 574, 3542, 18494, 43414, 145222, 235998, 591934, 860846, 1779974, 2256422, 4678982, 5195750, 9675918, 10983742, 18942014, 19873966, 35294686, 34670454, 57349894, 59707494, 92513302, 90116222, 149759302, 135668414, 213025750, 209185718, 311753358, 287144326, 450333422
Offset: 0

Views

Author

Alois P. Heinz, Mar 22 2023

Keywords

Crossrefs

Column k=7 of A302996.

Programs

  • Maple
    a:= n-> coeff((sum(x^(j^2), j=-n..n))^7, x, n^2):
    seq(a(n), n=0..30);
    # second Maple program:
    b:= proc(n, t) option remember; `if`(n=0, 1, `if`(n<0 or t<1, 0,
          b(n, t-1) +2*add(b(n-j^2, t-1), j=1..isqrt(n))))
        end:
    a:= n-> b(n^2, 7):
    seq(a(n), n=0..30);
  • Mathematica
    SquaresR[7, Range[0, 30]^2] (* Paolo Xausa, Aug 21 2025 *)

Formula

a(n) = [x^(n^2)] (Sum_{j=-n..n} x^(j^2))^7.
a(n) = A008451(n^2).
a(n) = A302996(n,7).

A374493 Number of ways of writing n^2 as a sum of 8 squares.

Original entry on oeis.org

1, 16, 1136, 12112, 74864, 252016, 859952, 1887888, 4793456, 8830096, 17893136, 28366288, 56672048, 77264112, 134040048, 190776112, 306783344, 386279728, 626936816, 752843856, 1179182864, 1429131216, 2014006448, 2368768912, 3628646192, 3937752016, 5485751952
Offset: 0

Views

Author

Seiichi Manyama, Jul 12 2024

Keywords

Crossrefs

Column k=8 of A302996.
Cf. A000143.

Programs

  • Mathematica
    SquaresR[8, Range[0,30]^2] (* Paolo Xausa, Aug 21 2025 *)
  • PARI
    a000143(n) = if(n==0, 1, 16*sumdiv(n, d, (-1)^(n+d)*d^3));
    a(n) = a000143(n^2);

Formula

a(n) = [x^(n^2)] (Sum_{j=-n..n} x^(j^2))^8.
a(n) = A000143(n^2).
a(n) is divisible by 16 for n > 0.
Showing 1-8 of 8 results.