login
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

%I #14 Nov 08 2023 15:23:00

%S 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,

%T 1,7,8,23,69,238,929,4015,1,8,9,26,78,269,1050,4538,21423,1,9,10,29,

%U 87,300,1171,5061,23892,122035,1,10,11,32,96,331,1292,5584,26361,134646,738424

%N Triangle read by rows. T(n, k) = (n-1)*Gould(k-1) + Bell(k) for n >= 0 and k >= 1, T(n, 0) = 1.

%F 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:

%F A = [n], P = [1], R = [1];

%F Repeat n times: R = [R, A], P = PS([A, P]), A = [P[end]];

%F Return R.

%e Triangle starts:

%e [0] 1;

%e [1] 1, 1;

%e [2] 1, 2, 3;

%e [3] 1, 3, 4, 11;

%e [4] 1, 4, 5, 14, 42;

%e [5] 1, 5, 6, 17, 51, 176;

%e [6] 1, 6, 7, 20, 60, 207, 808;

%e [7] 1, 7, 8, 23, 69, 238, 929, 4015;

%e [8] 1, 8, 9, 26, 78, 269, 1050, 4538, 21423;

%e [9] 1, 9, 10, 29, 87, 300, 1171, 5061, 23892, 122035;

%p Bell := n -> combinat:-bell(n):

%p Gould := proc(n) option remember; ifelse(n = 0, 1,

%p add(binomial(n, k-1)*Gould(n-k), k = 1..n)) end:

%p T := (n, k) -> (n-1)*Gould(k-1) + Bell(k):

%p for n from 0 to 9 do seq(T(n,k), k = 0..n) od;

%p # Alternative:

%p alias(PS = ListTools:-PartialSums):

%p A352686Row := proc(n) local a, k, P, R; a := n; P := [1]; R := [1];

%p for k from 1 to n do R := [op(R), a]; P := PS([a, op(P)]); a := P[-1] od; R end:

%p seq(print(A352686Row(n)), n = 0..9);

%t gould[n_] := gould[n] = If[n == 0, 1, Sum[Binomial[n, k+1]*gould[k], {k, 0, n-1}]];

%t T[n_, k_] := (n-1) gould[k-1] + BellB[k];

%t Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* _Jean-François Alcover_, Nov 08 2023, after first Maple program *)

%o (Julia)

%o function A352686Row(n)

%o a = BigInt(n == 0 ? 1 : n)

%o P = BigInt[1]; T = BigInt[1]

%o for k in 1:n

%o T = push!(T, a)

%o P = cumsum(pushfirst!(P, a))

%o a = P[end]

%o end

%o T end

%o for n in 0:9 println(A352686Row(n)) end

%Y Subtriangle of A352682. Main diagonal A352684.

%Y Cf. A000110 (Bell), A040027 (Gould).

%K nonn,tabl

%O 0,5

%A _Peter Luschny_, Mar 31 2022