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

A286416 Number T(n,k) of entries in the k-th last blocks of all set partitions of [n]; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 3, 1, 8, 6, 1, 24, 25, 10, 1, 83, 98, 63, 15, 1, 324, 399, 338, 135, 21, 1, 1400, 1746, 1727, 980, 257, 28, 1, 6609, 8271, 8874, 6426, 2455, 448, 36, 1, 33758, 42284, 47191, 40334, 20506, 5474, 730, 45, 1, 185136, 231939, 263458, 250839, 158827, 57239, 11128, 1128, 55, 1
Offset: 1

Views

Author

Alois P. Heinz, May 08 2017

Keywords

Examples

			T(3,2) = 6 because the number of entries in the second last blocks of all set partitions of [3] (123, 12|3, 13|2, 1|23, 1|2|3) is 0+2+2+1+1 = 6.
Triangle T(n,k) begins:
     1;
     3,    1;
     8,    6,    1;
    24,   25,   10,    1;
    83,   98,   63,   15,    1;
   324,  399,  338,  135,   21,   1;
  1400, 1746, 1727,  980,  257,  28,  1;
  6609, 8271, 8874, 6426, 2455, 448, 36, 1;
  ...
		

Crossrefs

Columns k=1-2 give: A038561 (for n>1), A286433.
Main diagonal and first lower diagonal give: A000012, A000217.
Row sums give A070071.

A352682 Array read by ascending antidiagonals. A(n, k) = (n-1)*Gould(k-1) + Bell(k) for n >= 0 and k >= 1, A(n, 0) = 1.

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 3, 3, 5, 6, 1, 4, 4, 8, 15, 21, 1, 5, 5, 11, 24, 52, 82, 1, 6, 6, 14, 33, 83, 203, 354, 1, 7, 7, 17, 42, 114, 324, 877, 1671, 1, 8, 8, 20, 51, 145, 445, 1400, 4140, 8536, 1, 9, 9, 23, 60, 176, 566, 1923, 6609, 21147, 46814
Offset: 0

Views

Author

Peter Luschny, Mar 28 2022

Keywords

Comments

The array defines a family of Bell-like sequences. The case n = 1 are the Bell numbers A000110, case n = 0 is A032347 and case n = 2 is A038561. The n-th sequence r(k) = T(n, k) is defined for k >= 0 by the recurrence r(k) = Sum_{j=0..k-1} binomial(k-1, j)*r(j) with r(0) = 1 and r(1) = n.

Examples

			Array starts:
n\k 0, 1,  2,  3,  4,   5,    6,    7,     8,      9, ...
---------------------------------------------------------
[0] 1, 0,  1,  2,  6,  21,   82,  354,  1671,   8536, ... A032347
[1] 1, 1,  2,  5, 15,  52,  203,  877,  4140,  21147, ... A000110
[2] 1, 2,  3,  8, 24,  83,  324, 1400,  6609,  33758, ... A038561
[3] 1, 3,  4, 11, 33, 114,  445, 1923,  9078,  46369, ... A038559
[4] 1, 4,  5, 14, 42, 145,  566, 2446, 11547,  58980, ... A352683
[5] 1, 5,  6, 17, 51, 176,  687, 2969, 14016,  71591, ...
[6] 1, 6,  7, 20, 60, 207,  808, 3492, 16485,  84202, ...
[7] 1, 7,  8, 23, 69, 238,  929, 4015, 18954,  96813, ...
[8] 1, 8,  9, 26, 78, 269, 1050, 4538, 21423, 109424, ...
[9] 1, 9, 10, 29, 87, 300, 1171, 5061, 23892, 122035, ...
		

Crossrefs

Diagonals: A352684 (main).
Cf. A040027 (Gould), A352686 (subtriangle).
Compare A352680 for a similar array based on the Catalan numbers.

Programs

  • Julia
    function BellRow(m, len)
        a = m; P = BigInt[1]; T = BigInt[1]
        for n in 1:len
            T = vcat(T, a)
            P = cumsum(vcat(a, P))
            a = P[end]
        end
    T end
    for n in 0:9 BellRow(n, 9) |> println end
  • Maple
    alias(PS = ListTools:-PartialSums):
    BellRow := proc(n, len) local a, k, P, T;
    a := n; P := [1]; T := [1];
    for k from 1 to len-1 do
       T := [op(T), a]; P := PS([a, op(P)]); a := P[-1] od;
    T end: seq(lprint(BellRow(n, 10)), n = 0..9);
  • Mathematica
    nmax = 10;
    BellRow[n_, len_] := Module[{a, k, P, T}, a = n; P = {1}; T = {1};
       For[k = 1, k <= len - 1, k++,
          T = Append[T, a]; P = Accumulate[Join[{a}, P]]; a = P[[-1]]];
       T];
    rows = Table[BellRow[n, nmax + 1], {n, 0, nmax}];
    A[n_, k_] := rows[[n + 1, k + 1]];
    Table[A[n - k, k], {n, 0, nmax}, {k, 0, n}] // Flatten (* Jean-François Alcover, Apr 15 2024, after Peter Luschny *)

Formula

Given a list T let PS(T) denote the list of partial sums of T. Given two list S and T let [S, T] denote the concatenation of the lists. Further let P[end] denote the last element of the list P. Row n of the array with length k can be computed by the following procedure:
A = [n], P = [1], R = [1];
Repeat k-1 times: R = [R, A], P = PS([A, P]), A = [P[end]];
Return R.

A046937 Triangle read by rows. Same rule as Aitken triangle (A011971) except T(0,0) = 1, T(1,0) = 2.

Original entry on oeis.org

1, 2, 3, 3, 5, 8, 8, 11, 16, 24, 24, 32, 43, 59, 83, 83, 107, 139, 182, 241, 324, 324, 407, 514, 653, 835, 1076, 1400, 1400, 1724, 2131, 2645, 3298, 4133, 5209, 6609, 6609, 8009, 9733, 11864, 14509, 17807, 21940, 27149, 33758
Offset: 0

Views

Author

Keywords

Examples

			Triangle starts:
[0] [   1]
[1] [   2,    3]
[2] [   3,    5,    8]
[3] [   8,   11,   16,    24]
[4] [  24,   32,   43,    59,    83]
[5] [  83,  107,  139,   182,   241,   324]
[6] [ 324,  407,  514,   653,   835,  1076,  1400]
[7] [1400, 1724, 2131,  2645,  3298,  4133,  5209,  6609]
[8] [6609, 8009, 9733, 11864, 14509, 17807, 21940, 27149, 33758]
		

Crossrefs

Borders give A038561.
Cf. A011971.

Programs

  • Haskell
    a046937 n k = a046937_tabl !! n !! k
    a046937_row n = a046937_tabl !! n
    a046937_tabl = [1] : iterate (\row -> scanl (+) (last row) row) [2,3]
    -- Reinhard Zumkeller, Jan 13 2013
  • Maple
    # Compare the analogue algorithm for the Catalan triangle in A350584.
    A046937Triangle := proc(len) local A, P, T, n; A := [2]; P := [1]; T := [[1]];
    for n from 1 to len-1 do P := ListTools:-PartialSums([A[-1], op(P)]);
    A := P; T := [op(T), P] od; T end:
    A046937Triangle(9): ListTools:-Flatten(%); # Peter Luschny, Mar 27 2022
  • Mathematica
    a[0, 0] = 1; a[1, 0] = 2; a[n_, 0] := a[n-1, n-1]; a[n_, k_] := a[n, k] = a[n, k-1] + a[n-1, k-1]; Table[a[n, k], {n, 0, 9}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jun 06 2013 *)

A352685 Array of Aitken-Bell triangles of order m (read by rows) read by ascending antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 1, 2, 2, 1, 1, 3, 3, 2, 1, 1, 4, 4, 3, 3, 2, 1, 5, 5, 4, 5, 5, 2, 1, 6, 6, 5, 7, 8, 5, 3, 1, 7, 7, 6, 9, 11, 8, 7, 4, 1, 8, 8, 7, 11, 14, 11, 11, 10, 6, 1, 9, 9, 8, 13, 17, 14, 15, 16, 15, 6, 1, 10, 10, 9, 15, 20, 17, 19, 22, 24, 15, 8, 1, 11, 11, 10, 17, 23, 20, 23, 28, 33, 24, 20, 11, 1, 12, 12, 11, 19, 26, 23, 27, 34, 42, 33, 32, 27, 15
Offset: 0

Views

Author

Peter Luschny, Mar 29 2022

Keywords

Comments

An Aitken-Bell triangle of order m is defined by T(0, 0) = 1, T(1, 0) = m, T(n, 0) = T(n-1, n-1) and T(n, k) = T(n, k-1) + T(n-1, k-1), for n >= 0 and 0 <= k <= n. The case m = 1 is Aitken's array A011971 with the first column the Bell numbers A000110, case m = 0 is the triangle A046934 with the first column A032347 and case m = 2 is the triangle A046937 with the first column A038561.

Examples

			Array starts:
[0] 1, 0,  1,  1,  1,  2,  2,  3,  4,  6,  6,   8,  11,  15, ... A046934
[1] 1, 1,  2,  2,  3,  5,  5,  7, 10, 15, 15,  20,  27,  37, ... A011971
[2] 1, 2,  3,  3,  5,  8,  8, 11, 16, 24, 24,  32,  43,  59, ... A046937
[3] 1, 3,  4,  4,  7, 11, 11, 15, 22, 33, 33,  44,  59,  81, ...
[4] 1, 4,  5,  5,  9, 14, 14, 19, 28, 42, 42,  56,  75, 103, ...
[5] 1, 5,  6,  6, 11, 17, 17, 23, 34, 51, 51,  68,  91, 125, ...
[6] 1, 6,  7,  7, 13, 20, 20, 27, 40, 60, 60,  80, 107, 147, ...
[7] 1, 7,  8,  8, 15, 23, 23, 31, 46, 69, 69,  92, 123, 169, ...
[8] 1, 8,  9,  9, 17, 26, 26, 35, 52, 78, 78, 104, 139, 191, ...
[9] 1, 9, 10, 10, 19, 29, 29, 39, 58, 87, 87, 116, 155, 213, ...
		

Crossrefs

The main diagonals of the triangles are in A352682.

Programs

  • Julia
    function BellTriangle(m, len)
        a = m; P = [1]; T = []
        for n in 1:len
            T = vcat(T, P)
            P = cumsum(vcat(a, P))
            a = P[end]
        end
    T end
    for n in 0:9 BellTriangle(n, 4) |> println end
  • Maple
    alias(PS = ListTools:-PartialSums):
    BellTriangle := proc(m, len) local a, k, P, T; a := m; P := [1]; T := [];
    for n from 1 to len  do T := [op(T), P]; P := PS([a, op(P)]); a := P[-1] od;
    ListTools:-Flatten(T) end:
    for n from 0 to 9 do print(BellTriangle(n, 5)) od; # Prints array by rows.
  • Mathematica
    nmax = 13;
    row[m_] := row[m] = Module[{T}, T[0, 0] = 1; T[1, 0] = m; T[n_, 0] := T[n, 0] = T[n-1, n-1]; T[n_, k_] := T[n, k] = T[n, k-1] + T[n-1, k-1]; Table[T[n, k], {n, 0, nmax}, {k, 0, n}] // Flatten];
    A[n_, k_] := row[n][[k+1]];
    Table[A[n-k, k], {n, 0, nmax}, {k, 0, n}] // Flatten (* Jean-François Alcover, Mar 07 2024 *)

Formula

Given a list T let PS(T) denote the list of partial sums of T. Given two list S and T let [S, T] denote the concatenation of the lists. Further let P[end] denote the last element of the list P. The Aitken-Bell triangle T of order m with n rows can be computed by the following procedure:
A = [m], P = [1], T = [];
Repeat n times: T = [T, P], P = PS([A, P]), A = [P[end]];
Return T.
Showing 1-4 of 4 results.