A composition of is an expression of as a sum of not necessarily distinct positive integers, where the order matters. Note that counts as a composition of .
Let be the number of compositions of with no part equal to 2.
For instance, because .
Find .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
We generate the compositions of n without 2 ’s recursively by the following process: to any such composition of n − 1 , one can add a 1 or increase the last summand by 1 .
However, this process needs two corrections.
First, we must separately generate those compositions that end in 3 , since they will not be generated by this recursive method. They come from adding a 3 to compositions of n − 3 .
Secondly, we must subtract the compositions of n − 1 that initially ended in 1 , since they would now end in 2 under this process. The number of such compositions corresponds to compositions of length n − 2 .
So, we have C n = 2 C n − 1 − C n − 2 + C n − 3 .
Starting from C 1 = C 2 = 1 ; C 3 = 2 , we get C 1 5 = 1 8 9 7 .