An S-restricted composition of a positive integer n is an ordered partition of n where each summand is drawn from a given subset S of positive integers. There are various problems regarding such compositions which have received attention in recent years. This paper is an attempt at finding a closed- form formula for the number of S-restricted compositions of n. To do so, we reduce the problem to finding solutions to corresponding so-called interpreters which are linear homogeneous recurrence relations with constant coefficients. Then, we reduce interpreters to Diophantine equations. Such equations are not in general solvable. Thus, we restrict our attention to those S-restricted composition problems whose interpreters have a small number of coefficients, thereby leading to solvable Diophantine equations. The formalism developed is then used to study the integer sequences related to some well-known cases of the S-restricted composition problem.
We study several restricted classes of compositions by giving one-to-one maps between them and different classes of restricted binary strings or pattern avoiding permutations. Inspired by the ECO method [8], new succession rules for these classes are presented. Finally, we obtain generating algorithms in Constant Amortized Time (CAT) for theses classes. A bijective proof is given for the following theorem: the number of compositions of n into odd parts equals the number of compositions of n + 1 into parts greater than one. Some commentary about the history of partitions and compositions is provided.