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

A382342 Triangle read by rows: T(n, k) is the number of partitions of n into k parts where 0 <= k <= n, and each part is one of two kinds.

Original entry on oeis.org

1, 0, 2, 0, 2, 3, 0, 2, 4, 4, 0, 2, 7, 6, 5, 0, 2, 8, 12, 8, 6, 0, 2, 11, 18, 17, 10, 7, 0, 2, 12, 26, 28, 22, 12, 8, 0, 2, 15, 34, 46, 38, 27, 14, 9, 0, 2, 16, 46, 64, 66, 48, 32, 16, 10, 0, 2, 19, 56, 94, 100, 86, 58, 37, 18, 11, 0, 2, 20, 70, 124, 152, 136, 106, 68, 42, 20, 12
Offset: 0

Views

Author

Peter Dolland, Mar 27 2025

Keywords

Examples

			Triangle starts:
 0 : [1]
 1 : [0, 2]
 2 : [0, 2,  3]
 3 : [0, 2,  4,  4]
 4 : [0, 2,  7,  6,  5]
 5 : [0, 2,  8, 12,  8,   6]
 6 : [0, 2, 11, 18, 17,  10,  7]
 7 : [0, 2, 12, 26, 28,  22, 12,  8]
 8 : [0, 2, 15, 34, 46,  38, 27, 14,  9]
 9 : [0, 2, 16, 46, 64,  66, 48, 32, 16, 10]
10 : [0, 2, 19, 56, 94, 100, 86, 58, 37, 18, 11]
  ...
		

Crossrefs

Row sums give A000712.
Cf. A008284 (1-kind case), A022597, A381895, A382345.

Programs

  • Maple
    b:= proc(n, i) option remember; expand(`if`(n=0, 1, `if`(i<1, 0,
          add(x^j*b(n-i*j, min(n-i*j, i-1))*(j+1), j=0..n/i))))
        end:
    T:= (n, k)-> coeff(b(n$2), x, k):
    seq(seq(T(n, k), k=0..n), n=0..11);  # Alois P. Heinz, Mar 27 2025
  • Mathematica
    b[n_, i_] := b[n, i] = Expand[If[n == 0, 1, If[i < 1, 0, Sum[x^j*b[n - i*j, Min[n - i*j, i - 1]]*(j + 1), {j, 0, n/i}]]]];
    T[n_, k_] := Coefficient[b[n, n], x, k];
    Table[Table[T[n, k], {k, 0, n}], {n, 0, 11}] // Flatten (* Jean-François Alcover, Apr 19 2025, after Alois P. Heinz *)
  • Python
    from sympy.utilities.iterables import partitions
    def t_row( n):
        if n == 0 : return [1]
        t = list( [0] * n)
        for p in partitions( n):
            fact = 1
            s = 0
            for k in p :
                s += p[k]
                fact *= 1 + p[k]
            if s > 0 :
                t[s - 1] += fact
        return [0] + t

Formula

T(n,n) = n + 1.
T(n,1) = 2 for n >= 1.
T(n,k) = A381895(n,k) - A381895(n,k-1) for 1 <= k <= n.
Sum_{k=0..n} (-1)^k * T(n,k) = A022597(n). - Alois P. Heinz, Mar 27 2025

A382345 Square array A(n,k), n>=0, k>=0, read by antidiagonals downwards, where n unlabeled objects are distributed into k containers of two kinds. Containers may be left empty.

Original entry on oeis.org

1, 2, 0, 3, 2, 0, 4, 4, 2, 0, 5, 6, 7, 2, 0, 6, 8, 12, 8, 2, 0, 7, 10, 17, 18, 11, 2, 0, 8, 12, 22, 28, 26, 12, 2, 0, 9, 14, 27, 38, 46, 34, 15, 2, 0, 10, 16, 32, 48, 66, 64, 46, 16, 2, 0, 11, 18, 37, 58, 86, 100, 94, 56, 19, 2, 0, 12, 20, 42, 68, 106, 136, 152, 124, 70, 20, 2, 0
Offset: 0

Views

Author

Peter Dolland, Mar 29 2025

Keywords

Examples

			Array starts:
 0 : [1, 2,  3,   4,   5,   6,   7,    8,    9,   10,   11]
 1 : [0, 2,  4,   6,   8,  10,  12,   14,   16,   18,   20]
 2 : [0, 2,  7,  12,  17,  22,  27,   32,   37,   42,   47]
 3 : [0, 2,  8,  18,  28,  38,  48,   58,   68,   78,   88]
 4 : [0, 2, 11,  26,  46,  66,  86,  106,  126,  146,  166]
 5 : [0, 2, 12,  34,  64, 100, 136,  172,  208,  244,  280]
 6 : [0, 2, 15,  46,  94, 152, 217,  282,  347,  412,  477]
 7 : [0, 2, 16,  56, 124, 214, 316,  426,  536,  646,  756]
 8 : [0, 2, 19,  70, 167, 302, 464,  640,  825, 1010, 1195]
 9 : [0, 2, 20,  84, 212, 406, 648,  922, 1212, 1512, 1812]
10 : [0, 2, 23, 100, 271, 542, 899, 1314, 1766, 2236, 2717]
...
		

Crossrefs

Antidiagonal sums give A000712.
Alternating antidiagonal sums give A073252.
Without empty containers: A381895.
Cf. A382342.

Programs

  • Maple
    b:= proc(n, i) option remember; expand(`if`(n=0, 1, `if`(i<1, 0,
          add(x^j*b(n-i*j, min(n-i*j, i-1))*(j+1), j=0..n/i))))
        end:
    A:= (n, k)-> coeff(b(n+k$2), x, k):
    seq(seq(A(n, d-n), n=0..d), d=0..11);  # Alois P. Heinz, Mar 29 2025
  • Mathematica
    b[n_, i_] := b[n, i] = Expand[If[n == 0, 1, If[i < 1, 0,
       Sum[x^j*b[n - i*j, Min[n - i*j, i - 1]]*(j + 1), {j, 0, n/i}]]]];
    A[n_, k_] := Coefficient[b[n + k, n + k], x, k];
    Table[Table[A[n, d - n], {n, 0, d}], {d, 0, 11}] // Flatten (* Jean-François Alcover, Apr 07 2025, after Alois P. Heinz *)
  • Python
    from sympy.utilities.iterables import partitions
    def a_row(n, length=11) -> list[int]:
        if n == 0 : return list(range(1, length + 1))
        t = [0] * length
        for p in partitions(n):
            fact = 1
            s = 0
            for k in p :
                s += p[k]
                fact *= p[k] + 1
            if s > 0 :
                t[s] += fact
        for i in range(1, length - 1):
            t[i+1] += t[i] * 2 - t[i-1]
        return t
    for n in range(11): print(a_row(n))

Formula

A(0,k) = k + 1.
A(1,k) = 2*k.
A(2,k+1) = 2 + 5 * k.
A(n,1) = 2.
A(n,k) = Sum_{i=0..k} (k + 1 - i) * A382342(n,i) for k <= n.
A(n,n+k) = A(n,n) + k * A000712(n).
A(n,k) = A382342(n,k) + 2 * A(n,k-1) - A(n,k-2) for 2 <= k <= n.
A(n,k) = A382342(n+k,k). - Alois P. Heinz, Mar 31 2025

A382025 Triangle read by rows: T(n, k) is the number of partitions of n with at most k parts where 0 <= k <= n, and each part is one of three kinds.

Original entry on oeis.org

1, 0, 3, 0, 3, 9, 0, 3, 12, 22, 0, 3, 18, 36, 51, 0, 3, 21, 57, 87, 108, 0, 3, 27, 82, 148, 193, 221, 0, 3, 30, 111, 225, 330, 393, 429, 0, 3, 36, 144, 333, 528, 681, 765, 810, 0, 3, 39, 184, 460, 808, 1106, 1316, 1424, 1479, 0, 3, 45, 225, 630, 1182, 1740, 2163, 2439, 2574, 2640
Offset: 0

Views

Author

Peter Dolland, Mar 12 2025

Keywords

Comments

The 1-kind case is Euler's table A026820.
The 2-kind case is A381895.

Examples

			Triangle starts:
 0 : [1]
 1 : [0, 3]
 2 : [0, 3,  9]
 3 : [0, 3, 12,  22]
 4 : [0, 3, 18,  36,  51]
 5 : [0, 3, 21,  57,  87,  108]
 6 : [0, 3, 27,  82, 148,  193,  221]
 7 : [0, 3, 30, 111, 225,  330,  393,  429]
 8 : [0, 3, 36, 144, 333,  528,  681,  765,  810]
 9 : [0, 3, 39, 184, 460,  808, 1106, 1316, 1424, 1479]
10 : [0, 3, 45, 225, 630, 1182, 1740, 2163, 2439, 2574, 2640]
...
		

Crossrefs

Main diagonal gives A000716.

Programs

  • Python
    from sympy import binomial
    from sympy.utilities.iterables import partitions
    from sympy.combinatorics.partitions import IntegerPartition
    kinds = 3 - 1   # the number of part kinds - 1
    def a382025_row( n):
        if n == 0 : return [1]
        t = list( [0] * n)
        for p in partitions( n):
            p = IntegerPartition( p).as_dict()
            fact = 1
            s = 0
            for k in p :
                s += p[k]
                fact *= binomial( kinds + p[k], kinds)
            if s > 0 :
                t[s - 1] += fact
        for i in range( n - 1):
            t[i+1] += t[i]
        return [0] + t

A382041 Triangle read by rows: T(n, k) is the number of partitions of n with at most k parts where 0 <= k <= n, and each part is one of four kinds.

Original entry on oeis.org

1, 0, 4, 0, 4, 14, 0, 4, 20, 40, 0, 4, 30, 70, 105, 0, 4, 36, 116, 196, 252, 0, 4, 46, 170, 350, 490, 574, 0, 4, 52, 236, 556, 896, 1120, 1240, 0, 4, 62, 310, 845, 1505, 2079, 2415, 2580, 0, 4, 68, 400, 1200, 2400, 3584, 4480, 4960, 5180, 0, 4, 78, 494, 1670, 3626, 5910, 7842, 9162, 9822, 10108
Offset: 0

Views

Author

Peter Dolland, Mar 12 2025

Keywords

Comments

Two unrestricted unary predicates on the parts set result in four kinds: The intersection, the both differences and the complement of the union.
The 1-kind case is Euler's table A026820.
The 2-kind case is A381895.
The 3-kind case is A382025.

Examples

			Triangle starts:
  0 : [1]
  1 : [0, 4]
  2 : [0, 4, 14]
  3 : [0, 4, 20,  40]
  4 : [0, 4, 30,  70,  105]
  5 : [0, 4, 36, 116,  196,  252]
  6 : [0, 4, 46, 170,  350,  490,  574]
  7 : [0, 4, 52, 236,  556,  896, 1120, 1240]
  8 : [0, 4, 62, 310,  845, 1505, 2079, 2415, 2580]
  9 : [0, 4, 68, 400, 1200, 2400, 3584, 4480, 4960, 5180]
 10 : [0, 4, 78, 494, 1670, 3626, 5910, 7842, 9162, 9822, 10108]
 ...
		

Crossrefs

Main diagonal gives A023003.

Programs

  • Python
    from sympy import binomial
    from sympy.utilities.iterables import partitions
    from sympy.combinatorics.partitions import IntegerPartition
    kinds = 4 - 1   # the number of part kinds - 1
    def a382041_row( n):
        if n == 0 : return [1]
        t = list( [0] * n)
        for p in partitions( n):
            p = IntegerPartition( p).as_dict()
            fact = 1
            s = 0
            for k in p :
                s += p[k]
                fact *= binomial( kinds + p[k], kinds)
            if s > 0 :
                t[s - 1] += fact
        for i in range( n - 1):
            t[i+1] += t[i]
        return [0] + t

A383352 Triangle read by rows: T(n, k) is the number of partitions of a 2-colored set of n objects into at most k parts where 0 <= k <= n, and each part is one of 2 kinds.

Original entry on oeis.org

1, 0, 4, 0, 6, 16, 0, 8, 32, 52, 0, 10, 63, 123, 158, 0, 12, 100, 264, 384, 440, 0, 14, 158, 506, 876, 1086, 1170, 0, 16, 224, 896, 1800, 2500, 2836, 2956, 0, 18, 317, 1491, 3489, 5359, 6542, 7046, 7211, 0, 20, 420, 2372, 6324, 10848, 14208, 16056, 16776, 16996
Offset: 0

Views

Author

Peter Dolland, Apr 24 2025

Keywords

Examples

			Triangle starts:
 0 : [1]
 1 : [0,  4]
 2 : [0,  6,  16]
 3 : [0,  8,  32,   52]
 4 : [0, 10,  63,  123,   158]
 5 : [0, 12, 100,  264,   384,   440]
 6 : [0, 14, 158,  506,   876,  1086,  1170]
 7 : [0, 16, 224,  896,  1800,  2500,  2836,  2956]
 8 : [0, 18, 317, 1491,  3489,  5359,  6542,  7046,  7211]
 9 : [0, 20, 420, 2372,  6324, 10848, 14208, 16056, 16776, 16996]
10 : [0, 22, 556, 3608, 11002, 20836, 29488, 34976, 37700, 38690, 38976]
...
		

Crossrefs

Row sums of A383351.
Cf. A381895 (1-color), A381891 (1-kind), A026820 (1-color, 1-kind).

Programs

  • Python
    from sympy import binomial
    from sympy.utilities.iterables import partitions
    def calc_w(k , m):
        s = 0
        for p in partitions(m, m=k+1):
            fact = 1
            j = k + 1
            for x in p :
                fact *= binomial(j, p[x]) * (x + 1) ** p[x]
                j -= p[x]
            s += fact
        return s
    def t_row(n):
        if n == 0 : return [1]
        t = list([0] * n)
        for p in partitions( n):
            fact = 1
            s = 0
            for k in p :
                s += p[k]
                fact *= calc_w(k, p[k])
            if s > 0 :
                t[s - 1] += fact
        for i in range(n - 1):
            t[i + 1] += t[i]
        return [0] + t

Formula

T(n,k) = Sum_{i=0..k} A383351(n,i).
T(n,1) = 2*n + 2 for n >= 1.
Showing 1-5 of 5 results.