A352686 Triangle read by rows. T(n, k) = (n-1)*Gould(k-1) + Bell(k) for n >= 0 and k >= 1, T(n, 0) = 1.
1, 1, 1, 1, 2, 3, 1, 3, 4, 11, 1, 4, 5, 14, 42, 1, 5, 6, 17, 51, 176, 1, 6, 7, 20, 60, 207, 808, 1, 7, 8, 23, 69, 238, 929, 4015, 1, 8, 9, 26, 78, 269, 1050, 4538, 21423, 1, 9, 10, 29, 87, 300, 1171, 5061, 23892, 122035, 1, 10, 11, 32, 96, 331, 1292, 5584, 26361, 134646, 738424
Offset: 0
Examples
Triangle starts: [0] 1; [1] 1, 1; [2] 1, 2, 3; [3] 1, 3, 4, 11; [4] 1, 4, 5, 14, 42; [5] 1, 5, 6, 17, 51, 176; [6] 1, 6, 7, 20, 60, 207, 808; [7] 1, 7, 8, 23, 69, 238, 929, 4015; [8] 1, 8, 9, 26, 78, 269, 1050, 4538, 21423; [9] 1, 9, 10, 29, 87, 300, 1171, 5061, 23892, 122035;
Programs
-
Julia
function A352686Row(n) a = BigInt(n == 0 ? 1 : n) P = BigInt[1]; T = BigInt[1] for k in 1:n T = push!(T, a) P = cumsum(pushfirst!(P, a)) a = P[end] end T end for n in 0:9 println(A352686Row(n)) end
-
Maple
Bell := n -> combinat:-bell(n): Gould := proc(n) option remember; ifelse(n = 0, 1, add(binomial(n, k-1)*Gould(n-k), k = 1..n)) end: T := (n, k) -> (n-1)*Gould(k-1) + Bell(k): for n from 0 to 9 do seq(T(n,k), k = 0..n) od; # Alternative: alias(PS = ListTools:-PartialSums): A352686Row := proc(n) local a, k, P, R; a := n; P := [1]; R := [1]; for k from 1 to n do R := [op(R), a]; P := PS([a, op(P)]); a := P[-1] od; R end: seq(print(A352686Row(n)), n = 0..9);
-
Mathematica
gould[n_] := gould[n] = If[n == 0, 1, Sum[Binomial[n, k+1]*gould[k], {k, 0, n-1}]]; T[n_, k_] := (n-1) gould[k-1] + BellB[k]; Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Nov 08 2023, after first Maple program *)
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 triangle T can be computed by the following procedure:
A = [n], P = [1], R = [1];
Repeat n times: R = [R, A], P = PS([A, P]), A = [P[end]];
Return R.