login
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.
5

%I #10 Jun 06 2018 11:36:12

%S 1,1,2,6,15,45,135,422,1357,4503,15301,53225,189070,684540,2522194,

%T 9441960,35867225,138080428,538155330,2121211604,8448577175,

%U 33974559322,137842934746,563885092371,2324435490519,9650120731330,40329864236526,169593208033062

%N 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.

%H Alois P. Heinz, <a href="/A293744/b293744.txt">Table of n, a(n) for n = 0..1000</a>

%F G.f.: Product_{j>=1} (1+x^j)^A049401(j).

%p g:= proc(n) option remember;

%p `if`(n<3, [1, 1, 2][n+1], ((3*n^2+17*n+15)*g(n-1)

%p +(n-1)*(13*n+9)*g(n-2) -15*(n-1)*(n-2)*g(n-3)) /

%p ((n+4)*(n+6)))

%p end:

%p b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,

%p add(b(n-i*j, i-1)*binomial(g(i), j), j=0..n/i)))

%p end:

%p a:= n-> b(n$2):

%p seq(a(n), n=0..35);

%t 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))];

%t 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}]]];

%t a[n_] := b[n, n];

%t Table[a[n], {n, 0, 35}] (* _Jean-François Alcover_, Jun 06 2018, from Maple *)

%Y Column k=5 of A293112.

%Y Cf. A049401, A293735.

%K nonn

%O 0,3

%A _Alois P. Heinz_, Oct 15 2017