(In reply to
Solution by Jer)
In the table below, each row below is the number of subsets of each size that have no consecutive letters of the alphabet in them. Beginning with a zero letter alphabet {} and word of length zero {}.
1
1 1
1 2
1 3 1
1 4 3
1 5 6 1
1 6 10 4
1 7 15 10 1
1 8 21 20 5
1 9 28 35 15 1.
To find the next row, add the previous row to the one before it with an offset (from adding an extra letter).
1 8 21 20 5
1 9 28 35 15 1
1 10 36 56 35 6
Pascal's triangle is lurking there on a diagonal. This means the numbers are the Combinations. In the 10th row the numbers are
C(11,0), C(10,1), C(9,2), C(8,3), C(7,4), C(6,5).
Corresponding to subsets of size 0,1,2,3,4,5.
The number of words is the number of subsets of each size, n multiplied by n!
1*0! + 10*1! + 36*2! + 56*3! + 35*4! + 6*5! = 1979
A general formula for an x letter alphabet would then be
Sum(n=0 to [(x+1)/2]) C(x+1n,n)*n!
For x=26 this formula agree with my previous post: 571177352091
Now to try to get a closed form.

Posted by Jer
on 20140325 15:00:05 