login
Number of sets of nonempty words over binary alphabet with a total of n letters of which 2 are the first letter.
2

%I #10 Feb 15 2023 10:23:08

%S 0,0,1,6,16,37,73,133,227,370,580,881,1305,1890,2687,3756,5175,7037,

%T 9460,12582,16577,21649,28048,36070,46072,58474,73778,92574,115559,

%U 143551,177510,218556,267997,327355,398394,483162,584023,703708,845361,1012600,1209573

%N Number of sets of nonempty words over binary alphabet with a total of n letters of which 2 are the first letter.

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

%F a(n) = A360634(n,2).

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

%e a(3) = 6: {aab}, {aba}, {baa}, {a,ab}, {a,ba}, {aa,b}.

%e a(4) = 16: {aabb}, {abab}, {abba}, {baab}, {baba}, {bbaa}, {a,abb}, {a,bab}, {a,bba}, {aa,bb}, {aab,b}, {ab,ba}, {aba,b}, {b,baa}, {a,ab,b}, {a,b,ba}.

%p g:= proc(n, i, j) option remember; convert(series(`if`(j=0, 1,

%p `if`(i<0, 0, add(g(n, i-1, j-k)*x^(i*k)*binomial(

%p binomial(n, i), k), k=0..j))), x, 3), polynom)

%p end:

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

%p add(b(n-i*j, i-1)*g(i$2, j), j=0..n/i))), x, 3), polynom)

%p end:

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

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

%Y Column k=2 of A360634.

%K nonn

%O 0,4

%A _Alois P. Heinz_, Feb 15 2023