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-10 of 18 results. Next

A175361 Partial sums of A000141.

Original entry on oeis.org

1, 13, 73, 233, 485, 797, 1341, 2301, 3321, 4197, 5757, 8157, 10237, 12277, 15541, 19701, 23793, 27273, 31653, 38853, 45405, 50013, 58173, 68733, 76957, 84769, 94969, 108089, 120569, 130673, 144817, 164017, 180397, 191917, 209317, 234277, 252673, 269113, 293593
Offset: 0

Views

Author

R. J. Mathar, Apr 24 2010

Keywords

Comments

The 6th row of A122510.

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[EllipticTheta[3,x]^6/(1-x),{x,0,35}],x] (* Stefano Spezia, Jun 21 2024 *)
  • Python
    from math import prod
    from sympy import factorint
    def A175361(n):
        c = 1
        for m in range(1,n+1):
            f = [(p,e,(0,1,0,-1)[p&3]) for p,e in factorint(m).items()]
            c += (prod((p**(e+1<<1)-a)//(p**2-a) for p, e, a in f)<<2)-prod(((k:=p**2*a)**(e+1)-1)//(k-1) for p, e, a in f)<<2
        return c # Chai Wah Wu, Jun 21 2024

Formula

a(n^2) = A055412(n).
G.f.: theta_3(x)^6 / (1 - x). - Ilya Gutkovskiy, Feb 13 2021

A190622 Omit the initial 1 from A000141 and take the Mobius transform.

Original entry on oeis.org

12, 48, 148, 192, 300, 336, 948, 768, 716, 1200, 2388, 1344, 2028, 2256, 3700, 3072, 3468, 3120, 7188, 4800, 3500, 5712, 10548, 5376, 7500, 8112, 12244, 9024, 10092, 8400, 19188, 12288, 8972, 13872, 23700, 12480, 16428, 17232, 25012, 19200, 20172, 15792, 36948, 22848, 17900, 25296, 44148, 21504, 27276, 30000
Offset: 1

Views

Author

N. J. A. Sloane, May 14 2011

Keywords

References

  • J. M. Borwein, D. H. Bailey and R. Girgensohn, Experimentation in Mathematics, A K Peters, Ltd., Natick, MA, 2004. x+357 pp. See p. 195.

A122141 Array: T(d,n) = number of ways of writing n as a sum of d squares, read by ascending antidiagonals.

Original entry on oeis.org

1, 1, 2, 1, 4, 0, 1, 6, 4, 0, 1, 8, 12, 0, 2, 1, 10, 24, 8, 4, 0, 1, 12, 40, 32, 6, 8, 0, 1, 14, 60, 80, 24, 24, 0, 0, 1, 16, 84, 160, 90, 48, 24, 0, 0, 1, 18, 112, 280, 252, 112, 96, 0, 4, 2, 1, 20, 144, 448, 574, 312, 240, 64, 12, 4, 0, 1, 22, 180, 672, 1136, 840, 544, 320, 24, 30, 8, 0
Offset: 1

Views

Author

R. J. Mathar, Oct 29 2006

Keywords

Comments

This is the transpose of the array in A286815.
T(d,n) is divisible by 2d for any n != 0 iff d is a power of 2. - Jianing Song, Sep 05 2018

Examples

			Array T(d,n) with rows d = 1,2,3,... and columns n = 0,1,2,3,... reads
  1  2   0   0    2    0     0     0     0     2      0 ...
  1  4   4   0    4    8     0     0     4     4      8 ...
  1  6  12   8    6   24    24     0    12    30     24 ...
  1  8  24  32   24   48    96    64    24   104    144 ...
  1 10  40  80   90  112   240   320   200   250    560 ...
  1 12  60 160  252  312   544   960  1020   876   1560 ...
  1 14  84 280  574  840  1288  2368  3444  3542   4424 ...
  1 16 112 448 1136 2016  3136  5504  9328 12112  14112 ...
  1 18 144 672 2034 4320  7392 12672 22608 34802  44640 ...
  1 20 180 960 3380 8424 16320 28800 52020 88660 129064 ...
		

Crossrefs

Cf. A000122 (1st row), A004018 (2nd row), A005875 (3rd row), A000118 (4th row), A000132 (5th row), A000141 (6th row), A008451 (7th row), A000143 (8th row), A008452 (9th row), A000144 (10th row), A008453 (11th row), A000145 (12th row), A276285 (13th row), A276286 (14th row), A276287 (15th row), A000152 (16th row).
Cf. A005843 (2nd column), A046092 (3rd column), A130809 (4th column).
Cf. A010052 (1st row divides 2), A002654 (2nd row divides 4), A046897 (4th row divides 8), A008457 (8th row divides 16), A302855 (16th row divides 32), A302857 (32nd row divides 64).

Programs

  • Maple
    A122141 := proc(d,n) local i,cnts ; cnts := 0 ; for i from -trunc(sqrt(n)) to trunc(sqrt(n)) do if n-i^2 >= 0 then if d > 1 then cnts := cnts+procname(d-1,n-i^2) ; elif n-i^2 = 0 then cnts := cnts+1 ; fi ; fi ; od ; cnts ;
    end:
    for diag from 1 to 14 do for n from 0 to diag-1 do d := diag-n ; printf("%d,",A122141(d,n)) ; od ; od;
    # second Maple program:
    A:= proc(d, n) option remember; `if`(n=0, 1, `if`(n<0 or d<1, 0,
          A(d-1, n) +2*add(A(d-1, n-j^2), j=1..isqrt(n))))
        end:
    seq(seq(A(h-n, n), n=0..h-1), h=1..14); # Alois P. Heinz, Jul 16 2014
  • Mathematica
    Table[ SquaresR[d - n, n], {d, 1, 12}, {n, 0, d - 1}] // Flatten (* Jean-François Alcover, Jun 13 2013 *)
    A[d_, n_] := A[d, n] = If[n==0, 1, If[n<0 || d<1, 0, A[d-1, n] + 2*Sum[A[d-1, n-j^2], {j, 1, Sqrt[n]}]]]; Table[A[h-n, n], {h, 1, 14}, {n, 0, h-1}] // Flatten (* Jean-François Alcover, Feb 28 2018, after Alois P. Heinz *)
  • Python
    from sympy.core.power import isqrt
    from functools import cache
    @cache
    def T(d, n):
      if n == 0: return 1
      if n < 0 or d < 1: return 0
      return T(d-1, n) + sum(T(d-1, n-(j**2)) for j in range(1, isqrt(n)+1)) * 2  # Darío Clavijo, Feb 06 2024

Formula

T(n,n) = A066535(n). - Alois P. Heinz, Jul 16 2014

A286815 Square array A(n,k), n>=0, k>=0, read by antidiagonals, where column k is the expansion of (Product_{j>=1} (1 - x^(2*j))^5/((1 - x^j)*(1 - x^(4*j)))^2)^k.

Original entry on oeis.org

1, 1, 0, 1, 2, 0, 1, 4, 0, 0, 1, 6, 4, 0, 0, 1, 8, 12, 0, 2, 0, 1, 10, 24, 8, 4, 0, 0, 1, 12, 40, 32, 6, 8, 0, 0, 1, 14, 60, 80, 24, 24, 0, 0, 0, 1, 16, 84, 160, 90, 48, 24, 0, 0, 0, 1, 18, 112, 280, 252, 112, 96, 0, 4, 2, 0, 1, 20, 144, 448, 574, 312, 240, 64, 12
Offset: 0

Views

Author

Seiichi Manyama, May 27 2017

Keywords

Comments

A(n,k) is the number of ways of writing n as a sum of k squares.
This is the transpose of the array in A122141.

Examples

			Square array begins:
   1, 1, 1,  1,  1, ...
   0, 2, 4,  6,  8, ...
   0, 0, 4, 12, 24, ...
   0, 0, 0,  8, 32, ...
   0, 2, 4,  6, 24, ...
		

Crossrefs

Programs

  • Maple
    A:= proc(n, k) option remember; `if`(n=0, 1, `if`(n<0 or k<1, 0,
          A(n, k-1) +2*add(A(n-j^2, k-1), j=1..isqrt(n))))
        end:
    seq(seq(A(n, d-n), n=0..d), d=0..12);  # Alois P. Heinz, May 27 2017
  • Mathematica
    A[n_, k_] := A[n, k] = If[n == 0, 1, If[n < 0 || k < 1, 0, A[n, k-1] + 2*Sum[A[n-j^2, k-1], {j, 1, Sqrt[n]}]]];
    Table[A[n, d-n], {d, 0, 12}, {n, 0, d}] // Flatten (* Jean-François Alcover, Feb 28 2018, after Alois P. Heinz *)

Formula

G.f. of column k: (Product_{j>=1} (1 - x^(2*j))^5/((1 - x^j)*(1 - x^(4*j)))^2)^k.

A000143 Number of ways of writing n as a sum of 8 squares.

Original entry on oeis.org

1, 16, 112, 448, 1136, 2016, 3136, 5504, 9328, 12112, 14112, 21312, 31808, 35168, 38528, 56448, 74864, 78624, 84784, 109760, 143136, 154112, 149184, 194688, 261184, 252016, 246176, 327040, 390784, 390240, 395136, 476672, 599152, 596736, 550368, 693504, 859952
Offset: 0

Views

Author

Keywords

Comments

The relevant identity for the o.g.f. is theta_3(x)^8 = 1 + 16*Sum_{j >= 1} j^3*x^j/(1 - (-1)^j*x^j). See the Hardy-Wright reference, p. 315. - Wolfdieter Lang, Dec 08 2016

Examples

			1 + 16*q + 112*q^2 + 448*q^3 + 1136*q^4 + 2016*q^5 + 3136*q^6 + 5504*q^7 + ...
		

References

  • N. J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 77, Eq. (31.61); p. 79 Eq. (32.32).
  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 121.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, pp. 314 - 315.

Crossrefs

8th column of A286815. - Seiichi Manyama, May 27 2017
Row d=8 of A122141.
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Cf. A004018, A000118, A000141 for the expansion of the powers of 2, 4, 6 of theta_3(x).

Programs

  • Julia
    # JacobiTheta3 is defined in A000122.
    A000143List(len) = JacobiTheta3(len, 8)
    A000143List(37) |> println # Peter Luschny, Mar 12 2018
    
  • Maple
    (sum(x^(m^2),m=-10..10))^8;
    with(numtheory); rJ := n-> if n=0 then 1 else 16*add((-1)^(n+d)*d^3, d in divisors(n)); fi; [seq(rJ(n),n=0..100)]; # N. J. A. Sloane, Sep 15 2018
  • Mathematica
    Table[SquaresR[8, n], {n, 0, 33}] (* Ray Chandler, Dec 06 2006 *)
    SquaresR[8,Range[0,50]] (* Harvey P. Dale, Aug 26 2011 *)
    QP = QPochhammer; s = (QP[q^2]^5/(QP[q]*QP[q^4])^2)^8 + O[q]^40; CoefficientList[s, q] (* Jean-François Alcover, Dec 01 2015, adapted from PARI *)
  • PARI
    {a(n) = if( n<1, n==0, 16 * (-1)^n * sumdiv( n, d, (-1)^d * d^3))}
    
  • PARI
    {a(n) = local(A); if( n<0, 0, A = x * O(x^n); polcoeff( (eta(x^2 + A)^5 / (eta(x + A) * eta(x^4 + A))^2)^8, n))} /* Michael Somos, Sep 25 2005 */
    
  • Python
    from math import prod
    from sympy import factorint
    def A000143(n): return prod((p**(3*(e+1))-(1 if p&1 else 15))//(p**3-1) for p, e in factorint(n).items())<<4 if n else 1 # Chai Wah Wu, Jun 21 2024
  • SageMath
    Q = DiagonalQuadraticForm(ZZ, [1]*8)
    Q.representation_number_list(60) # Peter Luschny, Jun 20 2014
    

Formula

Expansion of theta_3(z)^8. Also a(n)=16*(-1)^n*Sum_{0
Expansion of phi(q)^8 in powers of q where phi() is a Ramanujan theta function. - Michael Somos, Mar 21 2008
Expansion of (eta(q^2)^5 / (eta(q) * eta(q^4))^2)^8 in powers of q. - Michael Somos, Sep 25 2005
G.f.: s(2)^40/(s(1)*s(4))^16, where s(k) := subs(q=q^k, eta(q)) and eta(q) is Dedekind's function, cf. A010815. [Fine]
Euler transform of period 4 sequence [16, -24, 16, -8, ...]. - Michael Somos, Apr 10 2005
a(n) = 16 * b(n) and b(n) is multiplicative with b(p^e) = (p^(3*e+3) - 1) / (p^3 - 1) -2[p<3]. - Michael Somos, Sep 25 2005
G.f.: 1 + 16 * Sum_{k>0} k^3 * x^k / (1 - (-x)^k). - Michael Somos, Sep 25 2005
A035016(n) = (-1)^n * a(n). 16 * A008457(n) = a(n) unless n=0.
Dirichlet g.f.: Sum_{n>=1} a(n)/n^s = 16*(1 - 2^(1-s) + 4^(2-s))*zeta(s)*zeta(s-3). [Borwein and Choi], R. J. Mathar, Jul 02 2012
a(n) = (16/n)*Sum_{k=1..n} A186690(k)*a(n-k), a(0) = 1. - Seiichi Manyama, May 27 2017
Sum_{k=1..n} a(k) ~ Pi^4 * n^4 /24. - Vaclav Kotesovec, Jul 12 2024

A008451 Number of ways of writing n as a sum of 7 squares.

Original entry on oeis.org

1, 14, 84, 280, 574, 840, 1288, 2368, 3444, 3542, 4424, 7560, 9240, 8456, 11088, 16576, 18494, 17808, 19740, 27720, 34440, 29456, 31304, 49728, 52808, 43414, 52248, 68320, 74048, 68376, 71120, 99456, 110964, 89936, 94864, 136080, 145222
Offset: 0

Keywords

References

  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 121.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 314.

Crossrefs

Row d=7 of A122141 and of A319574, 7th column of A286815.

Programs

  • Maple
    series((sum(x^(m^2),m=-10..10))^7, x, 101);
    # Alternative
    #(requires at least Maple 17, and only works as long as a(n) <= 10^16 or so):
    N:= 1000: # to get a(0) to a(N)
    with(SignalProcessing):
    A:= Vector(N+1,datatype=float[8],i-> piecewise(i=1,1,issqr(i-1),2,0)):
    A2:= Convolution(A,A)[1..N+1]:
    A4:= Convolution(A2,A2)[1..N+1]:
    A5:= Convolution(A,A4)[1..N+1];
    A7:= Convolution(A2,A5)[1..N+1];
    map(round,convert(A7,list)); # Robert Israel, Jul 16 2014
    # Alternative
    A008451list := proc(len) series(JacobiTheta3(0, x)^7, x, len+1);
    seq(coeff(%,x,j), j=0..len-1) end: A008451list(37); # Peter Luschny, Oct 02 2018
  • Mathematica
    Table[SquaresR[7, n], {n, 0, 36}] (* Ray Chandler, Nov 28 2006 *)
    SquaresR[7,Range[0,50]] (* Harvey P. Dale, Aug 26 2011 *)
  • Python
    # uses Python code from A000141
    from math import isqrt
    def A008451(n): return A000141(n)+(sum(A000141(n-k**2) for k in range(1,isqrt(n)+1))<<1) # Chai Wah Wu, Jun 23 2024
  • Sage
    Q = DiagonalQuadraticForm(ZZ, [1]*7)
    Q.representation_number_list(37) # Peter Luschny, Jun 20 2014
    

Formula

G.f.: theta_3(0,x)^7, where theta_3 is the third Jacobi theta function. - Robert Israel, Jul 16 2014
a(n) = (14/n)*Sum_{k=1..n} A186690(k)*a(n-k), a(0) = 1. - Seiichi Manyama, May 27 2017

Extensions

Extended by Ray Chandler, Nov 28 2006

A319574 A(n, k) = [x^k] JacobiTheta3(x)^n, square array read by descending antidiagonals, A(n, k) for n >= 0 and k >= 0.

Original entry on oeis.org

1, 0, 1, 0, 2, 1, 0, 0, 4, 1, 0, 0, 4, 6, 1, 0, 2, 0, 12, 8, 1, 0, 0, 4, 8, 24, 10, 1, 0, 0, 8, 6, 32, 40, 12, 1, 0, 0, 0, 24, 24, 80, 60, 14, 1, 0, 0, 0, 24, 48, 90, 160, 84, 16, 1, 0, 2, 4, 0, 96, 112, 252, 280, 112, 18, 1, 0, 0, 4, 12, 64, 240, 312, 574, 448, 144, 20, 1
Offset: 0

Author

Peter Luschny, Oct 01 2018

Keywords

Comments

Number of ways of writing k as a sum of n squares.

Examples

			[ 0] 1,  0,    0,    0,     0,     0,     0      0,     0,     0, ... A000007
[ 1] 1,  2,    0,    0,     2,     0,     0,     0,     0,     2, ... A000122
[ 2] 1,  4,    4,    0,     4,     8,     0,     0,     4,     4, ... A004018
[ 3] 1,  6,   12,    8,     6,    24,    24,     0,    12,    30, ... A005875
[ 4] 1,  8,   24,   32,    24,    48,    96,    64,    24,   104, ... A000118
[ 5] 1, 10,   40,   80,    90,   112,   240,   320,   200,   250, ... A000132
[ 6] 1, 12,   60,  160,   252,   312,   544,   960,  1020,   876, ... A000141
[ 7] 1, 14,   84,  280,   574,   840,  1288,  2368,  3444,  3542, ... A008451
[ 8] 1, 16,  112,  448,  1136,  2016,  3136,  5504,  9328, 12112, ... A000143
[ 9] 1, 18,  144,  672,  2034,  4320,  7392, 12672, 22608, 34802, ... A008452
[10] 1, 20,  180,  960,  3380,  8424, 16320, 28800, 52020, 88660, ... A000144
   A005843,   v, A130809,  v,  A319576,  v ,   ...      diagonal: A066535
           A046092,    A319575,       A319577,     ...
		

References

  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 121.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954.
  • J. Carlos Moreno and Samuel S. Wagstaff Jr., Sums Of Squares Of Integers, Chapman & Hall/CRC, (2006).

Crossrefs

Variant starting with row 1 is A122141, transpose of A286815.

Programs

  • Maple
    A319574row := proc(n, len) series(JacobiTheta3(0, x)^n, x, len+1);
    [seq(coeff(%, x, j), j=0..len-1)] end:
    seq(print([n], A319574row(n, 10)), n=0..10);
    # Alternative, uses function PMatrix from A357368.
    PMatrix(10, n -> A000122(n-1)); # Peter Luschny, Oct 19 2022
  • Mathematica
    A[n_, k_] := If[n == k == 0, 1, SquaresR[n, k]];
    Table[A[n-k, k], {n, 0, 11}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Nov 03 2018 *)
  • Sage
    for n in (0..10):
        Q = DiagonalQuadraticForm(ZZ, [1]*n)
        print(Q.theta_series(10).list())

A340905 Number of ways to write n as an ordered sum of 6 squares of positive integers.

Original entry on oeis.org

1, 0, 0, 6, 0, 0, 15, 0, 6, 20, 0, 30, 15, 0, 60, 12, 15, 60, 31, 60, 30, 60, 90, 36, 86, 60, 120, 120, 15, 180, 141, 60, 165, 140, 180, 186, 120, 180, 285, 156, 126, 360, 255, 216, 270, 260, 390, 240, 262, 420, 426, 360, 210, 540, 530, 216, 540, 540, 480, 600, 300, 600, 825, 312, 576, 840
Offset: 6

Author

Ilya Gutkovskiy, Jan 31 2021

Keywords

Programs

  • Maple
    b:= proc(n, t) option remember;
          `if`(n=0, `if`(t=0, 1, 0), `if`(t<1, 0, add((s->
          `if`(s>n, 0, b(n-s, t-1)))(j^2), j=1..isqrt(n))))
        end:
    a:= n-> b(n, 6):
    seq(a(n), n=6..71);  # Alois P. Heinz, Jan 31 2021
  • Mathematica
    nmax = 71; CoefficientList[Series[(EllipticTheta[3, 0, x] - 1)^6/64, {x, 0, nmax}], x] // Drop[#, 6] &

Formula

G.f.: (theta_3(x) - 1)^6 / 64, where theta_3() is the Jacobi theta function.

A276285 Number of ways of writing n as a sum of 13 squares.

Original entry on oeis.org

1, 26, 312, 2288, 11466, 41808, 116688, 265408, 535704, 1031914, 1899664, 3214224, 5043376, 7801744, 12066912, 17689152, 24443978, 34039200, 48210760, 64966096, 83323344, 109157152, 145532816, 185245632, 227110416, 284788010, 363737712
Offset: 0

Author

Ilya Gutkovskiy, Aug 27 2016

Keywords

Comments

More generally, the ordinary generating function for the number of ways of writing n as a sum of k squares is theta_3(0, q)^k = 1 + 2*k*q + 2*(k - 1)*k*q^2 + (4/3)*(k - 2)*(k - 1)*k*q^3 + (2/3)*((k - 3)*(k - 2)*(k - 1) + 3)*k*q^4 + (4/15) *(k - 1)*k*(k^3 - 9*k^2 + 26*k - 9)*q^5 + ..., where theta is the Jacobi theta functions.

Crossrefs

13th column of A286815. - Seiichi Manyama, May 27 2017
Row d=13 of A122141.
Cf. Number of ways of writing n as a sum of k squares: A004018 (k = 2), A005875 (k = 3), A000118 (k = 4), A000132 (k = 5), A000141 (k = 6), A008451 (k = 7), A000143 (k = 8), A008452 (k = 9), A000144 (k = 10), A008453 (k = 11), A000145 (k = 12), this sequence (k = 13), A000152 (k = 16).

Programs

  • Mathematica
    Table[SquaresR[13, n], {n, 0, 26}]

Formula

G.f.: theta_3(0,q)^13, where theta_3(x,q) is the third Jacobi theta function.
a(n) = (26/n)*Sum_{k=1..n} A186690(k)*a(n-k), a(0) = 1. - Seiichi Manyama, May 27 2017

A340988 Number of partitions of n into 6 distinct nonzero squares.

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 2, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 3, 2, 0, 1, 2, 1, 1, 1, 0, 3, 0, 0, 4, 1, 0, 1
Offset: 91

Author

Ilya Gutkovskiy, Feb 02 2021

Keywords

Showing 1-10 of 18 results. Next