Skip to main content
1 of 3
Steve Huntsman
  • 15.4k
  • 7
  • 75
  • 130

Chris Phan's comment sounds right to me, but you may be able to do this more quickly, though OEIS doesn't seem to have any details on rows or columns of the below array except that they're (at least often) multinomial coefficients. I have computed these numbers in MATLAB using this stuff:

for n=1:8,for k=1:9,L=lookup(k,n);L1(k,n)=sum(sum((L==1),2)>0);end,end,L1

L1 =

       1           0           0           0           0           0           0           0
       2           1           2           2           2           2           2           2
       3           3           7           9          12          15          18          21
       4           6          16          25          40          58          80         106
       5          10          30          55         101         165         255         375
       6          15          50         105         216         391         666        1071
       7          21          77         182         413         819        1520        2646
       8          28         112         294         728        1568        3144        5881
       9          36         156         450        1206        2802        6030       12051
Steve Huntsman
  • 15.4k
  • 7
  • 75
  • 130