login
Number of sets of nonempty words with a total of n letters over n-ary alphabet such that within each prefix of a word every letter of the alphabet is at least as frequent as the subsequent alphabet letter.
6

%I #26 Jun 16 2018 19:33:03

%S 1,1,2,6,15,45,136,430,1415,4845,17235,63509,242854,959904,3926209,

%T 16564083,72097127,322898943,1487602607,7034420691,34122991199,

%U 169499127425,861596397518,4475340840980,23738200183570,128427236055296,708248486616539,3977551340260517

%N Number of sets of nonempty words with a total of n letters over n-ary 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="/A293114/b293114.txt">Table of n, a(n) for n = 0..800</a>

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

%F Weigh transform of A000085.

%e a(0) = 1: {}.

%e a(1) = 1: {a}.

%e a(2) = 2: {aa}, {ab}.

%e a(3) = 6: {a,aa}, {a,ab}, {aaa}, {aab}, {aba}, {abc}.

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

%p `if`(n<2, 1, g(n-1)+(n-1)*g(n-2))

%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 < 2, 1, g[n - 1] + (n - 1)*g[n - 2]];

%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 Main diagonal of A293112.

%Y Row sums of A293113 and of A293815.

%Y Cf. A000085, A182172, A293110, A306009.

%K nonn

%O 0,3

%A _Alois P. Heinz_, Sep 30 2017