OFFSET
0,9
LINKS
Alois P. Heinz, Antidiagonals n = 0..140, flattened
Peter Luschny, The Bell transform
EXAMPLE
[1, 1, 1, 1, 1, 1, 1, 1, 1, ...] A000012
[1, 1, 2, 5, 15, 52, 203, 877, 4140, ...] A000110
[1, 1, 2, 6, 23, 106, 568, 3459, 23544, ...] A187761
[1, 1, 2, 6, 24, 119, 700, 4748, 36403, ...] A264432
[1, 1, 2, 6, 24, 120, 719, 5013, 39812, ...]
[1, 1, 2, 6, 24, 120, 720, 5039, 40285, ...]
[... ...]
[1, 1, 2, 6, 24, 120, 720, 5040, 40320, ...] A000142 = main diagonal.
MAPLE
A:= proc(n, h) option remember; `if`(min(n, h)=0, 1, add(
binomial(n-1, j-1)*A(j-1, h-1)*A(n-j, h), j=1..n))
end:
seq(seq(A(n, d-n), n=0..d), d=0..12); # Alois P. Heinz, Aug 21 2017
MATHEMATICA
A[n_, h_]:=A[n, h]=If[Min[n, h]==0, 1, Sum[Binomial[n - 1, j - 1] A[j - 1, h - 1] A[n - j, h] , {j, n}]]; Table[A[n, d - n], {d, 0, 12}, {n, 0, d}]//Flatten (* Indranil Ghosh, Aug 21 2017, after maple code *)
PROG
(Sage) # uses[bell_transform from A264428]
def bell_number_matrix(ord, len):
b = [1]*len; L = [b]
for k in (1..ord-1):
b = [sum(bell_transform(n, b)) for n in range(len)]
L.append(b)
return matrix(ZZ, L)
print(bell_number_matrix(6, 9))
(Python)
from sympy.core.cache import cacheit
from sympy import binomial
@cacheit
def A(n, h): return 1 if min(n, h)==0 else sum([binomial(n - 1, j - 1)*A(j - 1, h - 1)*A(n - j, h) for j in range(1, n + 1)])
for d in range(13): print([A(n, d - n) for n in range(d + 1)]) # Indranil Ghosh, Aug 21 2017, after Maple code
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Peter Luschny, Dec 06 2015
STATUS
approved