A261838 Number of compositions of n into distinct parts where each part i is marked with a word of length i over a k-ary alphabet (k=1,2,3,...) whose letters appear in alphabetical order and all k letters occur at least once in the composition.
1, 1, 2, 20, 48, 264, 4296, 14528, 89472, 593248, 19115360, 75604544, 599169408, 4141674240, 40147321344, 2159264715776, 10240251475456, 92926573965184, 746025520714112, 7285397378650112, 82900557619046912, 7796186873306241024, 41825012467664893440
Offset: 0
Keywords
Examples
a(0) = 1: the empty composition. a(1) = 1: 1a. a(2) = 2: 2aa (for k=1), 2ab (for k=2).
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..300
Programs
-
Maple
b:= proc(n, i, p, k) option remember; `if`(i*(i+1)/2
n, 0, b(n-i, i-1, p+1, k)*binomial(i+k-1, k-1)))) end: a:= n-> add(add(b(n$2, 0, k-i)*(-1)^i*binomial(k, i), i=0..k), k=0..n): seq(a(n), n=0..25); -
Mathematica
b[n_, i_, p_, k_] := b[n, i, p, k] = If[i*(i+1)/2 < n, 0, If[n == 0, p!, b[n, i-1, p, k] + If[i>n, 0, b[n-i, i-1, p+1, k]*Binomial[i+k-1, k-1]]]]; a[n_] := Sum[b[n, n, 0, k-i]*(-1)^i*Binomial[k, i], {k, 0, n}, {i, 0, k}]; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Feb 25 2017, translated from Maple *)
Comments