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 13 results. Next

A025428 Number of partitions of n into 4 nonzero squares.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Records occur at n= 4, 28, 52, 82, 90, 130, 162, 198, 202, 210,.... - R. J. Mathar, Sep 15 2015

Crossrefs

Cf. A000414, A000534, A025357-A025375, A216374, A025416 (greedy inverse).
Column k=4 of A243148.

Programs

  • Maple
    A025428 := proc(n)
        local a,i,j,k,lsq ;
        a := 0 ;
        for i from 1 do
            if 4*i^2 > n then
                return a;
            end if;
            for j from i do
                if i^2+3*j^2 > n then
                    break;
                end if;
                for k from j do
                    if i^2+j^2+2*k^2 > n then
                        break;
                    end if;
                    lsq := n-i^2-j^2-k^2 ;
                    if lsq >= k^2 and issqr(lsq) then
                        a := a+1 ;
                    end if;
                end do:
            end do:
        end do:
    end proc:
    seq(A025428(n),n=1..40) ; # R. J. Mathar, Jun 15 2018
    # second Maple program:
    b:= proc(n, i, t) option remember; `if`(n=0, `if`(t=0, 1, 0),
         `if`(i<1 or t<1, 0, b(n, i-1, t)+`if`(i^2>n, 0, b(n-i^2, i, t-1))))
        end:
    a:= n-> b(n, isqrt(n), 4):
    seq(a(n), n=0..100);  # Alois P. Heinz, Apr 14 2019
  • Mathematica
    nn = 100; lim = Sqrt[nn]; t = Table[0, {nn}]; Do[n = a^2 + b^2 + c^2 + d^2; If[n <= nn, t[[n]]++], {a, lim}, {b, a, lim}, {c, b, lim}, {d, c, lim}]; t (* T. D. Noe, Sep 28 2012 *)
    f[n_] := Length@ IntegerPartitions[n, {4}, Range[ Floor[ Sqrt[n - 1]]]^2]; Array[f, 105] (* Robert G. Wilson v, Sep 28 2012 *)
  • PARI
    A025428(n)=sum(a=1,n,sum(b=1,a,sum(c=1,b,sum(d=1,c,a^2+b^2+c^2+d^2==n))))
    
  • PARI
    A025428(n)=sum(a=1,sqrtint(max(n-3,0)), sum(b=1,min(sqrtint(n-a^2-2),a), sum(c=1,min(sqrtint(n-a^2-b^2-1),b),issquare(n-a^2-b^2-c^2,&d) & d <= c )))
    
  • PARI
    A025428(n)=sum(a=sqrtint(max(n,4)\4),sqrtint(max(n-3,0)), sum(b=sqrtint((n-a^2)\3-1)+1,min(sqrtint(n-a^2-2),a), sum(c=sqrtint((t=n-a^2-b^2)\2-1)+1, min(sqrtint(t-1),b), issquare(t-c^2) ))) \\ - M. F. Hasler, Sep 17 2012
    for(n=1,100,print1(A025428(n),","))
    
  • PARI
    T(n)={a=matrix(n,4,i,j,0);for(d=1,sqrtint(n),forstep(i=n,d*d+1,-1,for(j=2,4,a[i,j]+=sum(k=1,j,if(k0,a[i-k*d*d,j-k],if(k==j&&i-k*d*d==0,1)))));a[d*d,1]=1);for(i=1,n,print(i" "a[i,4]))} /* Robert Gerbicz, Sep 28 2012 */

Formula

For n>0, a(n) = ( A063730(n) + 6*A213024(n) + 3*A063725(n/2) + 8*A092573(n) + 6*A010052(n/4) ) / 24. - Max Alekseyev, Sep 30 2012
a(n) = ( A000118(n) - 4*A005875(n) - 6*A004018(n) - 12*A000122(n) - 15*A000007(n) + 12*A014455(n) - 24*A033715(n) - 12*A000122(n/2) + 12*A004018(n/2) + 32*A033716(n) - 32*A000122(n/3) + 48*A000122(n/4) ) / 384. - Max Alekseyev, Sep 30 2012
a(n) = [x^n y^4] Product_{k>=1} 1/(1 - y*x^(k^2)). - Ilya Gutkovskiy, Apr 19 2019
a(n) = Sum_{k=1..floor(n/4)} Sum_{j=k..floor((n-k)/3)} Sum_{i=j..floor((n-j-k)/2)} A010052(i) * A010052(j) * A010052(k) * A010052(n-i-j-k). - Wesley Ivan Hurt, Apr 19 2019

Extensions

Values of a(0..10^4) double-checked by M. F. Hasler, Sep 17 2012

A063725 Number of ordered pairs (x,y) of positive integers such that x^2 + y^2 = n.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Aug 23 2001

Keywords

Comments

a(A018825(n))=0; a(A000404(n))>0; a(A081324(n))=1; a(A004431(n))>1. - Reinhard Zumkeller, Aug 16 2011

Examples

			a(5) = 2 from the solutions (1,2) and (2,1).
		

Crossrefs

Cf. A000404 (the numbers n that can be represented in this form).
Column k=2 of A337165.

Programs

  • Haskell
    a063725 n =
       sum $ map (a010052 . (n -)) $ takeWhile (< n) $ tail a000290_list
    a063725_list = map a063725 [0..]
    -- Reinhard Zumkeller, Aug 16 2011
    
  • Mathematica
    nn = 100; t = Table[0, {nn}]; s = Sqrt[nn]; Do[n = x^2 + y^2; If[n <= nn, t[[n]]++], {x, s}, {y, s}]; Join[{0}, t] (* T. D. Noe, Apr 03 2011 *)
  • PARI
    a(n)=if(n==0, return(0)); my(f=factor(n)); prod(i=1, #f~, if(f[i, 1]%4==1, f[i, 2]+1, f[i, 2]%2==0 || f[i, 1]==2)) - issquare(n) \\ Charles R Greathouse IV, May 18 2016
    
  • Python
    from math import prod
    from sympy import factorint
    def A063725(n):
        f = factorint(n)
        return prod(1 if p==2 else (e+1 if p&3==1 else (e+1)&1) for p, e in f.items())-(not any(e&1 for e in f.values())) if n else 0 # Chai Wah Wu, May 17 2023

Formula

G.f.: (Sum_{m=1..inf} x^(m^2))^2.
a(n) = ( A004018(n) - 2*A000122(n) + A000007(n) )/4. - Max Alekseyev, Sep 29 2012
G.f.: (theta_3(q) - 1)^2/4, where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Aug 08 2018

A337165 Number T(n,k) of compositions of n into k nonzero squares; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

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

Views

Author

Alois P. Heinz, Feb 03 2021

Keywords

Examples

			Triangle T(n,k) begins:
  1;
  0, 1;
  0, 0, 1;
  0, 0, 0, 1;
  0, 1, 0, 0, 1;
  0, 0, 2, 0, 0,  1;
  0, 0, 0, 3, 0,  0,  1;
  0, 0, 0, 0, 4,  0,  0, 1;
  0, 0, 1, 0, 0,  5,  0, 0, 1;
  0, 1, 0, 3, 0,  0,  6, 0, 0, 1;
  0, 0, 2, 0, 6,  0,  0, 7, 0, 0, 1;
  0, 0, 0, 3, 0, 10,  0, 0, 8, 0, 0, 1;
  0, 0, 0, 1, 4,  0, 15, 0, 0, 9, 0, 0, 1;
  ...
		

Crossrefs

Row sums give A006456.
T(2n,n) gives A338464.
Main diagonal gives A000012.

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, 1, add((s->
         `if`(s>n, 0, expand(x*b(n-s))))(j^2), j=1..isqrt(n)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n)):
    seq(T(n), n=0..14);
  • Mathematica
    b[n_] := b[n] = If[n == 0, 1, Sum[With[{s = j^2},
         If[s>n, 0, Expand[x*b[n - s]]]], {j, 1, Sqrt[n]}]];
    T[n_] := CoefficientList[b[n], x];
    T /@ Range[0, 14] // Flatten (* Jean-François Alcover, Feb 07 2021, after Alois P. Heinz *)

Formula

G.f. of column k: (Sum_{j>=1} x^(j^2))^k.
Sum_{k=0..n} k * T(n,k) = A281704(n).
Sum_{k=0..n} (-1)^k * T(n,k) = A317665(n).

A063691 Number of solutions to x^2 + y^2 + z^2 = n in positive integers.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 3, 0, 0, 3, 0, 3, 1, 0, 6, 0, 0, 3, 3, 3, 0, 6, 3, 0, 3, 0, 6, 4, 0, 6, 6, 0, 0, 6, 3, 6, 3, 0, 9, 0, 0, 9, 6, 3, 3, 6, 6, 0, 1, 6, 6, 6, 0, 6, 12, 0, 6, 6, 0, 9, 0, 6, 12, 0, 0, 6, 12, 3, 3, 12, 6, 0, 3, 3, 12, 7, 3, 12, 6, 0, 0, 12, 3, 9, 6, 0, 15, 0, 3, 15
Offset: 0

Views

Author

Andrew A. Doroshev (andy(AT)ip.rsu.ru), Aug 23 2001

Keywords

Examples

			a(5)=0;
a(6)=3 because 1^2+1^2+2^2 = 1^2+2^2+1^2 = 2^2+1^2+1^2 = 6;
a(27)=4 because 1^2+1^2+5^2 = 1^2+5^2+1^2 = 3^2+3^2+3^2 = 5^2+1^2+1^2 = 27.
		

Crossrefs

Sequence without zeros: A014465.
Cf. A063725, A063730, A211639 (partial sums).
Column k=3 of A337165.

Programs

  • Mathematica
    r[n_] := Reduce[ x>0 && y>0 && z>0 && x^2 + y^2 + z^2 == n, {x, y, z}, Integers]; a[n_] := Which[rn = r[n]; rn === False, 0, Head[rn] === Or, Length[rn], True, 1]; Table[a[n], {n, 0, 89}](* Jean-François Alcover, May 10 2012 *)
    (EllipticTheta[3, 0, x] - 1)^3/8 + O[x]^100 // CoefficientList[#, x]& (* Jean-François Alcover, Jul 30 2017 *)

Formula

G.f.: (Sum_{m>=1} x^(m^2))^3.

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

Views

Author

Ilya Gutkovskiy, Jan 31 2021

Keywords

Crossrefs

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.

A340946 Number of ways to write n as an ordered sum of 9 squares of positive integers.

Original entry on oeis.org

1, 0, 0, 9, 0, 0, 36, 0, 9, 84, 0, 72, 126, 0, 252, 135, 36, 504, 156, 252, 630, 288, 756, 576, 606, 1260, 756, 1207, 1260, 1584, 2052, 1008, 2727, 2688, 1764, 3663, 2718, 3816, 4608, 2853, 5418, 6048, 4620, 5868, 7506, 7464, 7308, 8442, 8958, 11088, 10404, 9684, 13986, 14184, 13020
Offset: 9

Views

Author

Ilya Gutkovskiy, Jan 31 2021

Keywords

Crossrefs

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, 9):
    seq(a(n), n=9..63);  # Alois P. Heinz, Jan 31 2021
  • Mathematica
    nmax = 63; CoefficientList[Series[(EllipticTheta[3, 0, x] - 1)^9/512, {x, 0, nmax}], x] // Drop[#, 9] &

Formula

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

A340481 Number of ways to write n as an ordered sum of 5 squares of positive integers.

Original entry on oeis.org

1, 0, 0, 5, 0, 0, 10, 0, 5, 10, 0, 20, 5, 0, 30, 6, 10, 20, 20, 30, 5, 30, 30, 20, 35, 10, 60, 45, 0, 60, 50, 30, 45, 50, 60, 70, 35, 30, 110, 50, 31, 110, 80, 80, 50, 70, 120, 70, 75, 90, 140, 110, 20, 140, 160, 60, 135, 120, 120, 180, 40, 130, 230, 80, 120, 170, 200, 155, 85, 200, 190
Offset: 5

Views

Author

Ilya Gutkovskiy, Jan 31 2021

Keywords

Crossrefs

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, 5):
    seq(a(n), n=5..75);  # Alois P. Heinz, Jan 31 2021
  • Mathematica
    nmax = 75; CoefficientList[Series[(EllipticTheta[3, 0, x] - 1)^5/32, {x, 0, nmax}], x] // Drop[#, 5] &

Formula

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

A340906 Number of ways to write n as an ordered sum of 7 squares of positive integers.

Original entry on oeis.org

1, 0, 0, 7, 0, 0, 21, 0, 7, 35, 0, 42, 35, 0, 105, 28, 21, 140, 49, 105, 105, 106, 210, 84, 182, 210, 217, 287, 105, 420, 378, 126, 497, 392, 420, 532, 350, 630, 714, 434, 546, 980, 742, 609, 980, 896, 1071, 882, 875, 1470, 1239, 1099, 1155, 1722, 1652, 882, 1933, 1995, 1554, 2072, 1505
Offset: 7

Views

Author

Ilya Gutkovskiy, Jan 31 2021

Keywords

Crossrefs

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, 7):
    seq(a(n), n=7..67);  # Alois P. Heinz, Jan 31 2021
  • Mathematica
    nmax = 67; CoefficientList[Series[(EllipticTheta[3, 0, x] - 1)^7/128, {x, 0, nmax}], x] // Drop[#, 7] &

Formula

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

A340915 Number of ways to write n as an ordered sum of 8 squares of positive integers.

Original entry on oeis.org

1, 0, 0, 8, 0, 0, 28, 0, 8, 56, 0, 56, 70, 0, 168, 64, 28, 280, 84, 168, 280, 176, 420, 224, 345, 560, 392, 616, 420, 848, 924, 336, 1246, 1064, 868, 1464, 988, 1680, 1820, 1120, 1904, 2464, 1932, 1904, 2870, 2752, 2772, 2912, 2892, 4256, 3640, 3248, 4480, 5040, 4760, 3696, 6120
Offset: 8

Views

Author

Ilya Gutkovskiy, Jan 31 2021

Keywords

Crossrefs

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, 8):
    seq(a(n), n=8..64);  # Alois P. Heinz, Jan 31 2021
  • Mathematica
    nmax = 64; CoefficientList[Series[(EllipticTheta[3, 0, x] - 1)^8/256, {x, 0, nmax}], x] // Drop[#, 8] &

Formula

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

A340947 Number of ways to write n as an ordered sum of 10 squares of positive integers.

Original entry on oeis.org

1, 0, 0, 10, 0, 0, 45, 0, 10, 120, 0, 90, 210, 0, 360, 262, 45, 840, 300, 360, 1260, 480, 1260, 1350, 1015, 2520, 1560, 2200, 3150, 2880, 4186, 2880, 5430, 6240, 3780, 8300, 7080, 7920, 11160, 7320, 13257, 14640, 10600, 16470, 18570, 18240, 19620, 22230, 25135, 27720, 28020, 28480, 38160
Offset: 10

Views

Author

Ilya Gutkovskiy, Jan 31 2021

Keywords

Crossrefs

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, 10):
    seq(a(n), n=10..62);  # Alois P. Heinz, Jan 31 2021
  • Mathematica
    nmax = 62; CoefficientList[Series[(EllipticTheta[3, 0, x] - 1)^10/1024, {x, 0, nmax}], x] // Drop[#, 10] &

Formula

G.f.: (theta_3(x) - 1)^10 / 1024, where theta_3() is the Jacobi theta function.
Showing 1-10 of 13 results. Next