New in Wolfram Mathematica 7: Integer Sequence Analysis  previous | next 
Find the Generating Function to Combinatorial Problems
Find the generating function for the number of 0,1 sequences of length n with two adjacent 1s.
In[1]:=

Click for copyable input
Table[Count[Tuples[{1, 0}, n], {___, 1, 1, ___}], {n, 10}]
Out[1]=



In[2]:=

Click for copyable input
Table[Count[Tuples[{1, 0}, n], {___, 1, 1, ___}], {n, 10}];

FindGeneratingFunction[%, x]
Out[2]=



In[3]:=

Click for copyable input
Table[Count[Tuples[{1, 0}, n], {___, 1, 1, ___}], {n, 10}];

FindGeneratingFunction[%, x];

Table[Count[Tuples[{1, 0}, n], {___, 1, 1, ___}], {n, 20}] - 

 CoefficientList[Series[%, {x, 0, 19}], x]
Out[3]=