A293744 Number of sets of nonempty words with a total of n letters over quinary alphabet such that within each prefix of a word every letter of the alphabet is at least as frequent as the subsequent alphabet letter.
1, 1, 2, 6, 15, 45, 135, 422, 1357, 4503, 15301, 53225, 189070, 684540, 2522194, 9441960, 35867225, 138080428, 538155330, 2121211604, 8448577175, 33974559322, 137842934746, 563885092371, 2324435490519, 9650120731330, 40329864236526, 169593208033062
Offset: 0
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
Programs
-
Maple
g:= proc(n) option remember; `if`(n<3, [1, 1, 2][n+1], ((3*n^2+17*n+15)*g(n-1) +(n-1)*(13*n+9)*g(n-2) -15*(n-1)*(n-2)*g(n-3)) / ((n+4)*(n+6))) end: b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0, add(b(n-i*j, i-1)*binomial(g(i), j), j=0..n/i))) end: a:= n-> b(n$2): seq(a(n), n=0..35);
-
Mathematica
g[n_] := g[n] = If[n<3, {1, 1, 2}[[n+1]], ((3*n^2 + 17*n + 15)*g[n-1] + (n-1)*(13*n + 9)*g[n-2] - 15*(n-1)*(n-2)*g[n-3]) / ((n+4)*(n+6))]; b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0, Sum[b[n - i*j, i - 1]* Binomial[g[i], j], {j, 0, n/i}]]]; a[n_] := b[n, n]; Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Jun 06 2018, from Maple *)
Formula
G.f.: Product_{j>=1} (1+x^j)^A049401(j).