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

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

A382343 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 3 kinds.

Original entry on oeis.org

1, 0, 3, 0, 3, 6, 0, 3, 9, 10, 0, 3, 15, 18, 15, 0, 3, 18, 36, 30, 21, 0, 3, 24, 55, 66, 45, 28, 0, 3, 27, 81, 114, 105, 63, 36, 0, 3, 33, 108, 189, 195, 153, 84, 45, 0, 3, 36, 145, 276, 348, 298, 210, 108, 55, 0, 3, 42, 180, 405, 552, 558, 423, 276, 135, 66
Offset: 0

Views

Author

Peter Dolland, Mar 27 2025

Keywords

Examples

			Triangle starts:
 0 : [1]
 1 : [0, 3]
 2 : [0, 3,  6]
 3 : [0, 3,  9,  10]
 4 : [0, 3, 15,  18,  15]
 5 : [0, 3, 18,  36,  30,  21]
 6 : [0, 3, 24,  55,  66,  45,  28]
 7 : [0, 3, 27,  81, 114, 105,  63,  36]
 8 : [0, 3, 33, 108, 189, 195, 153,  84,  45]
 9 : [0, 3, 36, 145, 276, 348, 298, 210, 108,  55]
10 : [0, 3, 42, 180, 405, 552, 558, 423, 276, 135, 66]
...
		

Crossrefs

Main diagonal gives A000217(n+1).
Row sums give A000716.
Cf. A008284 (1-kind), A382342 (2-kind).

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+2)*(j+1)/2, j=0..n/i))))
        end:
    T:= (n, k)-> coeff(b(n$2), x, k):
    seq(seq(T(n, k), k=0..n), n=0..10);  # 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+2)*(j+1)/2, {j, 0, n/i}]]]];
    T[n_, k_] := Coefficient[b[n, n], x, k];
    Table[Table[T[n, k], {k, 0, n}], {n, 0, 10}] // Flatten (* Jean-François Alcover, Jul 30 2025, after Alois P. Heinz *)
  • Python
    from sympy import binomial
    from sympy.utilities.iterables import partitions
    kinds = 3 - 1   # the number of part kinds - 1
    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 *= binomial( kinds + p[k], kinds)
            if s > 0 :
                t[s - 1] += fact
        return [0] + t

Formula

T(n,n) = binomial(n + 2, 2) = A000217(n + 1).
T(n,1) = 3 for n >= 1.
T(n,k) = A382025(n,k) - A382025(n,k-1) for 1 <= k <= n.
Sum_{k=0..n} (-1)^k * T(n,k) = A022598(n). - Alois P. Heinz, Mar 27 2025

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

Original entry on oeis.org

1, 3, 0, 6, 3, 0, 10, 9, 3, 0, 15, 18, 15, 3, 0, 21, 30, 36, 18, 3, 0, 28, 45, 66, 55, 24, 3, 0, 36, 63, 105, 114, 81, 27, 3, 0, 45, 84, 153, 195, 189, 108, 33, 3, 0, 55, 108, 210, 298, 348, 276, 145, 36, 3, 0, 66, 135, 276, 423, 558, 552, 405, 180, 42, 3, 0, 78, 165, 351, 570, 819, 936, 858, 549, 225, 45, 3, 0
Offset: 0

Views

Author

Peter Dolland, Mar 30 2025

Keywords

Examples

			Array starts:
 0 : [1, 3,  6,  10,   15,   21,   28,    36,    45,    55,    66]
 1 : [0, 3,  9,  18,   30,   45,   63,    84,   108,   135,   165]
 2 : [0, 3, 15,  36,   66,  105,  153,   210,   276,   351,   435]
 3 : [0, 3, 18,  55,  114,  195,  298,   423,   570,   739,   930]
 4 : [0, 3, 24,  81,  189,  348,  558,   819,  1131,  1494,  1908]
 5 : [0, 3, 27, 108,  276,  552,  936,  1428,  2028,  2736,  3552]
 6 : [0, 3, 33, 145,  405,  858, 1532,  2427,  3543,  4880,  6438]
 7 : [0, 3, 36, 180,  549, 1248, 2340,  3861,  5811,  8190, 10998]
 8 : [0, 3, 42, 225,  741, 1785, 3510,  6000,  9300, 13410, 18330]
 9 : [0, 3, 45, 271,  957, 2451, 5051,  8967, 14307, 21126, 29424]
10 : [0, 3, 51, 324, 1227, 3312, 7137, 13125, 21552, 32553, 46194]
...
		

Crossrefs

Antidiagonal sums give A000716.
Alternating antidiagonal sums give A107635.
Without empty containers: A382025.
Cf. A382343, A000217, 2 kinds: 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+2)*(j+1)/2, 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 31 2025
  • Python
    from sympy import binomial
    from sympy.utilities.iterables import partitions
    def a_row(n, length=11) :
        if n == 0 : return [ binomial( k + 2, 2) for k in range( length) ]
        t = list( [0] * length)
        for p in partitions( n):
            fact = 1
            s = 0
            for k in p :
                s += p[k]
                fact *= binomial( 2 + p[k], 2)
            if s > 0 :
                t[s] += fact
        a = list( [0] * length)
        for i in range( 1, length):
            for j in range( i, 0, -1):
                a[i] += t[j] * binomial( i - j + 2, 2)
        return a
    for n in range(11): print(a_row(n))

Formula

A(0,k) = binomial(k + 2, 2) = A000217(k + 1).
A(1,k) = 3 * binomial(k + 1, 2).
A(n,1) = 3.
A(n,k) = Sum_{i=0..k} binomial(k + 2 - i, 2) * A382343(n,i) for k <= n.
A(n,k) = A382343(n+k,k).
Showing 1-3 of 3 results.