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

A243148 Triangle read by rows: T(n,k) = number of partitions of n into k nonzero squares; n >= 0, 0 <= k <= n.

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1
Offset: 0

Views

Author

Alois P. Heinz, May 30 2014

Keywords

Examples

			T(20,5) = 2 = #{ (16,1,1,1,1), (4,4,4,4,4) } since 20 = 4^2 + 4 * 1^2 = 5 * 2^2.
Triangle T(n,k) begins:
  1;
  0, 1;
  0, 0, 1;
  0, 0, 0, 1;
  0, 1, 0, 0, 1;
  0, 0, 1, 0, 0, 1;
  0, 0, 0, 1, 0, 0, 1;
  0, 0, 0, 0, 1, 0, 0, 1;
  0, 0, 1, 0, 0, 1, 0, 0, 1;
  0, 1, 0, 1, 0, 0, 1, 0, 0, 1;
  0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1;
  0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1;
  0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1;
  (...)
		

Crossrefs

Columns k = 0..10 give: A000007, A010052 (for n>0), A025426, A025427, A025428, A025429, A025430, A025431, A025432, A025433, A025434.
Row sums give A001156.
T(2n,n) gives A111178.
T(n^2,n) gives A319435.
T(n,k) = 1 for n in A025284, A025321, A025357, A294675, A295670, A295797 (for k = 2..7, respectively).

Programs

  • Maple
    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:
    T:= (n, k)-> b(n, isqrt(n), k):
    seq(seq(T(n, k), k=0..n), n=0..14);
    # second Maple program:
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          b(n, i-1)+(s-> `if`(s>n, 0, expand(x*b(n-s, i))))(i^2)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n, isqrt(n))):
    seq(T(n), n=0..14);  # Alois P. Heinz, Oct 30 2021
  • Mathematica
    b[n_, i_, k_, t_] := b[n, i, k, t] = If[n == 0, If[t == 0, 1, 0], If[i < 1 || t < 1, 0, b[n, i-1, k, t] + If[i^2 > n, 0, b[n-i^2, i, k, t-1]]]]; T[n_, k_] := b[n, Sqrt[n] // Floor, k, k]; Table[Table[T[n, k], {k, 0, n}], {n, 0, 14}] // Flatten (* Jean-François Alcover, Jun 06 2014, after Alois P. Heinz *)
    T[n_, k_] := Count[PowersRepresentations[n, k, 2], r_ /; FreeQ[r, 0]]; T[0, 0] = 1; Table[T[n, k], {n, 0, 14}, {k, 0, n}] // Flatten (* Jean-François Alcover, Feb 19 2016 *)
  • PARI
    T(n,k,L=n)=if(n>k*L^2, 0, k>n-3, k==n, k<2, issquare(n,&n) && n<=L*k, k>n-6, n-k==3, L=min(L,sqrtint(n-k+1)); sum(r=0,min(n\L^2,k-1),T(n-r*L^2,k-r,L-1), n==k*L^2)) \\ M. F. Hasler, Aug 03 2020

Formula

T(n,k) = [x^n y^k] 1/Product_{j>=1} (1-y*x^A000290(j)).
Sum_{k=1..n} k * T(n,k) = A281541(n).
Sum_{k=1..n} n * T(n,k) = A276559(n).
Sum_{k=0..n} (-1)^k * T(n,k) = A292520(n).

A319799 Number of partitions of 2n into exactly n positive triangular numbers.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 4, 3, 4, 3, 5, 5, 7, 5, 7, 7, 9, 9, 9, 11, 12, 14, 14, 14, 17, 17, 21, 20, 23, 24, 27, 28, 31, 32, 36, 37, 42, 43, 47, 50, 53, 58, 61, 64, 69, 72, 82, 83, 91, 92, 102, 107, 115, 118, 128, 135, 147, 152, 159, 169, 181
Offset: 0

Views

Author

Alois P. Heinz, Sep 28 2018

Keywords

Crossrefs

Programs

  • Maple
    h:= proc(n) option remember; `if`(n<1, 0,
          `if`(issqr(8*n+1), n, h(n-1)))
        end:
    b:= proc(n, i, k) option remember; `if`(n=0, `if`(k=0, 1, 0),
          `if`(i*kn, 0, b(n, h(i-1), k)+b(n-i, h(min(n-i, i)), k-1)))
        end:
    a:= n-> b(2*n, h(2*n), n):
    seq(a(n), n=0..80);
  • Mathematica
    h[n_] := h[n] = If[n < 1, 0, If[IntegerQ@Sqrt[8*n + 1], n, h[n - 1]]];
    b[n_, i_, k_] := b[n, i, k] = If[n == 0, If[k == 0, 1, 0], If[i*k < n || k > n, 0, b[n, h[i - 1], k] + b[n - i, h[Min[n - i, i]], k - 1]]];
    a[n_] := b[2n, h[2n], n];
    a /@ Range[0, 80] (* Jean-François Alcover, Mar 12 2021, after Alois P. Heinz *)

Formula

a(n) = [x^(2n) y^n] 1/Product_{j>=1} (1-y*x^A000217(j)).
a(n) = A319797(2n,n).
G.f.: Product_{k>=1} 1 / (1 - x^(k*(k + 3)/2)). - Ilya Gutkovskiy, Jan 31 2021

A338464 Number of ways to write 2*n as an ordered sum of n squares of positive integers.

Original entry on oeis.org

1, 0, 0, 3, 0, 0, 15, 0, 8, 84, 0, 110, 495, 0, 1092, 3018, 120, 9520, 18870, 2907, 77520, 120270, 43890, 606188, 780023, 531300, 4620200, 5161377, 5651100, 34622172, 35045340, 55234560, 256503672, 245772464, 508930224, 1886151225, 1788167610, 4491607230
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 31 2021

Keywords

Comments

Also number of ways to write n as an ordered sum of n nonnegative numbers one less than a square.

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(2*n, n):
    seq(a(n), n=0..39);  # Alois P. Heinz, Feb 04 2021
  • Mathematica
    Table[SeriesCoefficient[((EllipticTheta[3, 0, x] - 1)/2)^n, {x, 0, 2 n}], {n, 0, 37}]

Formula

a(n) = [x^(2*n)] ((theta_3(x) - 1) / 2)^n, where theta_3() is the Jacobi theta function.
a(n) = [x^n] (Sum_{k>=0} x^(k*(k + 2)))^n.
a(n) = A337165(2n,n). - Alois P. Heinz, Feb 04 2021

A052261 Smallest integer that can be expressed as the sum of n squares of positive integers in exactly n distinct ways, or 0 if no such number exists.

Original entry on oeis.org

1, 50, 54, 52, 53, 54, 55, 56, 57, 61, 67, 66, 67, 68, 74, 0, 79, 83, 87, 83, 84, 88, 0, 93, 96, 105, 101, 110, 106, 102, 116, 0, 108, 0, 0, 0, 117, 0, 117, 121, 0, 125, 0, 135, 0, 0, 0, 134, 0, 137, 145, 144, 143, 0, 0, 156, 0, 0, 152, 0, 0, 157, 0, 0, 0, 169, 0, 166, 0, 166, 0
Offset: 1

Views

Author

David M. Grumm (dmg(AT)head-cfa.harvard.edu), Feb 03 2000

Keywords

Comments

a(16) > 119; values for a(17) through a(22) are 79, 83, 87, 83, 84, 88.
a(16) > 10000, a(23) > 10000, if they exist. - Naohiro Nomoto, Aug 22 2001
If the number of ways to write m as the sum of n squares is at least x for m in the range k^2 to 2*k^2 + 2*k + 1, it is at least x for any larger m; take the smallest square j^2 greater than x/2 and x - j^2 >= m^2 has at least x representations, none of which obviously can exceed j^2. The 0's for n=16 and 23 can be verified in this way with k=10; 32 to 35 with k=11; 36 with k=12; 38 to 49 with k=13; and 54 up with k=14. For n sufficiently large, a(n) = (index of n in A111178) + n, or 0 if n does not occur in A111178. - Franklin T. Adams-Watters, Jul 15 2006

Examples

			a(2) = 50 = 1^2 + 7^2 = 5^2 + 5^2.
		

Crossrefs

Programs

  • Mathematica
    a[1] = b[1] = 1; a[2] = b[2] = 50; b[n_] := b[n] = If[a[n-1] > 0, a[n-1], b[n-1]]; a[n_] := a[n] = (an=0; For[k = b[n-1]-8, k <= b[n-1]+14, k++, pr = PowersRepresentations[k, n, 2]; If[n == Count[pr, r_ /; FreeQ[r, 0]], an = k; Break[]]]; an); Table[an = a[n]; Print[n, " ", an]; an, {n, 1, 71}](* Jean-François Alcover, Jan 27 2012 *)
  • PARI
    numsumsq(n, m) = local(p, i); p=1+x*O(x^m)+y*O(y^n);for(i=1,sqrtint(m),p=p/(1-x^i^2*y));p=polcoeff(p,n,y);vector(m,i,polcoeff(p,i))
    vecfind(v, x) = local(i, y); for(i=1,matsize(v)[2],if(v[i]==x,y=i;break()));y
    a(n, m=1000) = v=numsumsq(n,m);vecfind(v,n) /* values must be checked */ \\ Franklin T. Adams-Watters, Jul 15 2006

Extensions

More terms from Franklin T. Adams-Watters, Jul 15 2006

A164098 Numbers of the form m * (k_1^2 + k_2^2 + ... + k_m^2).

Original entry on oeis.org

1, 4, 9, 10, 16, 18, 20, 25, 26, 27, 28, 33, 34, 36, 40, 42, 48, 49, 50, 51, 52, 54, 55, 57, 58, 60, 63, 64, 65, 66, 68, 70, 72, 74, 76, 78, 80, 81, 82, 84, 85, 87, 88, 90, 91, 92, 95, 99, 100, 102, 104, 105, 106, 108, 110, 112, 114, 115, 116, 120, 121, 122, 123, 124, 125
Offset: 1

Views

Author

Jonas Wallgren, Aug 10 2009, Aug 17 2009

Keywords

Comments

From Franklin T. Adams-Watters, Aug 29 2009: (Start)
The k_i must all be positive integers.
Note that every integer > 33 is the sum of 5 positive squares, and for n > 5, every integer > n+13 is the sum of n positive squares. (End)
The complement of this sequence includes: A000040, A037074, A143206, 2 * A002145, and 3 * A094712. - Robert Israel, Jan 27 2025

Examples

			34 = 2*(4^2 + 1^2), 42 = 3*(3^2 + 2^2 + 1^2), thus 34 and 42 are in the sequence.
		

Crossrefs

Programs

  • Maple
    g:= proc(y,m)
      # can we write y as sum of m positive squares?
       option remember;
       local x;
       if y < m then return false fi;
       if m = 1 then return issqr(y) fi;
       if issqr(y-m+1) then return true fi;
       for x from 1 while x^2 + m-1 < y do
         if procname(y-x^2,m-1) then return true fi
       od;
       false
    end proc:
    filter:= proc(n)
      ormap(t -> g(n/t, t), numtheory:-divisors(n))
    end proc:
    select(filter, [$1..1000]); # Robert Israel, Jan 26 2025
  • PARI
    issumsqs(n,k) = if(n<=0||k<=0,return(k==0&&n==0)); forstep(j=sqrtint(n),max(sqrtint(n\k),1),-1,if(issumsqs(n-j^2,k-1),return(1)));0
    isa(n)=local(ds);ds=divisors(n);for(k=1,(#ds+1)\2,if(issumsqs(n\ds[k],ds[k]),return(1)));0
    for(n=1,200,if(isa(n),print1(n","))) \\ Franklin T. Adams-Watters, Aug 29 2009

Extensions

More terms from Franklin T. Adams-Watters, Aug 29 2009

A302836 a(n) = [x^n] Product_{k>=1} 1/(1 - n*x^(k^2)).

Original entry on oeis.org

1, 1, 4, 27, 260, 3150, 46872, 825944, 16810048, 387952668, 10010010100, 285526191874, 8921263237056, 303013028232642, 11116057874586840, 438023675344410000, 18451248777413066768, 827408674110381669305, 39353155876513869320412, 1978708139249503877752798
Offset: 0

Views

Author

Ilya Gutkovskiy, Apr 13 2018

Keywords

Crossrefs

Programs

  • Mathematica
    Table[SeriesCoefficient[Product[1/(1 - n x^k^2), {k, 1, n}], {x, 0, n}], {n, 0, 19}]

Formula

a(n) ~ n^n * (1 + 1/n^3 + 1/n^6 + 1/n^8 + 1/n^9 + 1/n^11 + 1/n^12 + 1/n^14 + 2/n^15 + 1/n^16 + 1/n^17 + 2/n^18 + 1/n^19 + 1/n^20 + 2/n^21 + 1/n^22 + 2/n^23 + 4/n^24 + 1/n^25 + 2/n^26 + 4/n^27 + 1/n^28 + 2/n^29 + 5/n^30 + ...), for coefficients see A111178. - Vaclav Kotesovec, Apr 13 2018
Showing 1-6 of 6 results.