INTEGERS: ELECTRONIC JOURNAL OF COMBINATORIAL NUMBER THEORY 5 (2005), #A11

COUNTING RISES, LEVELS, AND DROPS IN COMPOSITIONS

Silvia Heubach

Department of Mathematics, California State University Los Angeles, Los Angeles, CA 90032, USA

                           sheubac@calstatela.edu

Toufik Mansour

Department of Mathematics, Haifa University, 31905 Haifa, Israel

                          toufik@math.haifa.ac.il

Received: 2/5/05, Accepted: 6/21/05, Published: 6/23/05

Abstract

A composition of n ∈ ℕ is an ordered collection of one or more positive integers whose sum is n. The number of summands is called the number of parts of the composition. A palindromic composition of n is a composition of n in which the summands are the same in the given or in reverse order. In this paper we study the generating function for the number of compositions (respectively, palindromic compositions) of n with m parts in a given set A ⊆ ℕ with respect to the number of rises, levels, and drops, and obtain previously known results as well as new results. We also generalize results for Carlitz compositions and for partitions.

AMS Classification Number: 05A05, 05A15

Key words: Compositions, palindromic compositions, Carlitz compositions, partitions, generating functions.

1. Introduction

A composition σ = σ_{1}σ_{2} … σ_{m} of n ∈ ℕ is an ordered collection of one or more positive integers whose sum is n. The number of summands, namely m, is called the number of parts of the composition. A palindromic composition of n ∈ ℕ is a composition for which σ_{1}σ_{2} … σ_{m} = σ_{m}σ_{m−1} … σ_{1}. A Carlitz composition is a composition of n ∈ ℕ in which no two consecutive parts are the same. We will derive the generating functions for the number of compositions, number of parts, and number of rises (a summand followed by a larger summand), levels (a summand followed by itself), and drops (a summand followed by a smaller summand) in all compositions of n whose parts are in a given set A. This unified framework generalizes earlier work by several authors.

Alladi and Hoggatt [1] considered A = {1, 2}, and derived generating functions for the number of compositions, number of parts, and number of rises, levels and drops in compositions and palindromic compositions of n, exhibiting connections to the Fibonacci sequence. Chinn and Heubach [7] generalized to A = {1, k} and derived all the respective generating functions. Chinn, Grimaldi and Heubach [5] considered the case A = ℕ, and derived generating functions for all quantities of interest. The focus of [5] was on explicit formulas for the quantities of interest, as well as combinatorial proofs for the connections among them. Carlitz [2] on the other hand approached the same topic from a generating function standpoint, and provided a connection to the Simon Newcomb problem [4]. (Note: Carlitz counts an extra rise and drop at the beginning and the end of each composition). Grimaldi [10] studied A = {m|m = 2k + 1, k ≥ 0}, and derived generating functions for the number of such compositions, as well as the number of parts, but not for the number of rises, levels and drops. In addition, he studied compositions without the summand 1 [9], which was generalized by Chinn and Heubach [6] to A = ℕ − {k}. In both cases, the authors only derived generating functions for the total number of compositions and the number of parts, but not for the number of rises, levels and drops. Finally, Hoggatt and Bricknell [11] looked at compositions with parts in a general set A, and gave generating functions for the number of compositions and the number of parts. This work was generalized by Heubach and Mansour [12], which also considered Carlitz compositions and gave additional generating functions for the number of compositions with a given number of parts in a set B ⊆ A. Most recently, Merlini et. al. [14] obtained results on the number of compositions and palindromic compositions using Riordan arrays.

We will present a unified framework which allows us to derive previously known results as well as new results by applying the main theorem to specific sets. The main result and its proof will be stated in Section 2. In the sections that follow we will state results for compositions (Section 3), palindromic compositions (Section 4), Carlitz compositions and Carlitz palindromic compositions (Section 5), and partitions (Section 6) of n with m parts in A, respectively. In each case, we will state general results for the total number, the number of levels, rises and drops, as well as give results for specific sets A, namely A = ℕ, A = {1, 2}, A = {1, k}, A = ℕ − {k}, and A = {m | m = 2k + 1, k ≥ 0}. In the cases of Carlitz compositions and partitions, we will restrict ourselves to the sets A = {1, 2}, A = {1, k} and A = {a, b}.

2. Main Result

Let ℕ be the set of all positive integers, and let A be any ordered (finite or infinite) set of positive integers, say A = {a_{1}, a_{2}, …, a_{k}}, where a_{1} < a_{2} < a_{3} < ⋯ < a_{k}, with the obvious modifications in the case |A| = ∞. In the theorems and proofs, we will treat the two cases together if possible, and will note if the case |A| = ∞ requires additional steps. For ease of notation, “ordered set” will always refer to a set whose elements are listed in increasing order.

For any ordered set A = {a_{1}, a_{2}, …, a_{k}} ⊆ ℕ, we denote the set of all compositions (respectively palindromic compositions) of n with parts in A by C_{n}^{A} (respectively P_{n}^{A}). For any composition σ, we denote the number of parts, rises, levels, and drops by parts(σ), rises(σ), levels(σ), and drops(σ), respectively. We define the generating function for the number of compositions (respectively palindromic compositions) of n with parts in a set A specifying the number of rises, levels, and drops as

C_{A}(x; y; r, ℓ, d) = ∑_{n≥0} ∑_{σ∈C_{n}^{A}} x^{n}y^{parts(σ)}r^{rises(σ)}ℓ^{levels(σ)}d^{drops(σ)}

and

P_{A}(x; y; r, ℓ, d) = ∑_{n≥0} ∑_{σ∈P_{n}^{A}} x^{n}y^{parts(σ)}r^{rises(σ)}ℓ^{levels(σ)}d^{drops(σ)}.

The main result of this paper gives explicit expressions for these two generating functions.

Theorem 2.1 Let A = {a_{1}, …, a_{k}} be any ordered subset of ℕ. Then

1. The generating function for compositions is given by

C_{A}(x; y; r, ℓ, d) = \frac{1 + (1 − d)∑_{j=1}^{k} (\frac{x^{a_{j}}y}{1 − x^{a_{j}}y(ℓ − d)}∏_{i=1}^{j−1} \frac{1 − x^{a_{i}}y(ℓ − r)}{1 − x^{a_{i}}y(ℓ − d)})}{1 − d ∑_{j=1}^{k} (\frac{x^{a_{j}}y}{1 − x^{a_{j}}y(ℓ − d)} ∏_{i=1}^{j−1} \frac{1 − x^{a_{i}}y(ℓ − r)}{1 − x^{a_{i}}y(ℓ − d)})}.

2. The generating function for palindromic compositions is given by

P_{A}(x; y; r, ℓ, d) = \frac{1 + ∑_{i=1}^{k} \frac{x^{a_{i}}y + x^{2a_{i}}y^{2}(ℓ − d r)}{1 − x^{2a_{i}}y^{2}(ℓ^{2} − d r)}}{1 − ∑_{i=1}^{k} \frac{x^{2a_{i}}y^{2}d r}{1 − x^{2a_{i}}y^{2}(ℓ^{2} − d r)}} .

Before giving the proof of Theorem 2.1, we will connect the generating function for compositions for A = ℕ with the result in [2] to obtain the following expression, which is hard to prove directly.

Corollary 2.2 Let e(u) = e(u, x) = ∑_{n=0}^{∞} \frac{u^{n}}{(x)_{n}} and (x)_{n} = (1 − x)(1 − x^{2}) ⋯ (1 − x^{n}). Then

∑_{j=1}^{∞} \frac{x^{j}y}{1 − x^{j}y(ℓ − d)} ∏_{i=1}^{j−1} \frac{1 − x^{i}y(ℓ − r)}{1 − x^{i}y(ℓ − d)} = \frac{(1 + d) · e(xy(l − d)) − (1 + r) · e(xy(l − r))}{d^{2} · e(xy(l − d)) + (r − d(r + 1)) · e(xy(l − r))}.

Proof. Since Carlitz counts an extra rise and fall at beginning and end, respectively, we need to adjust our generating function by a factor of r · d. Setting the two generating functions, namely Theorem 2.1 Part (1) for A = ℕ and the right-hand side of Eq. (4.6) [2], equal, we get that

r · d · \frac{1 + (1 − d) ∑_{j=1}^{∞} \frac{x^{j}y}{1−x^{j}y(ℓ−d)} ∏_{i=1}^{j−1} \frac{1−x^{i}y(ℓ−r)}{1−x^{i}y(ℓ−d)}}{1 − d ∑_{j=1}^{∞} \frac{x^{j}y}{1−x^{j}y(ℓ−d)} ∏_{i=1}^{j−1} \frac{1−x^{i}y(ℓ−r)}{1−x^{i}y(ℓ−d)}} = r · d\frac{e(xy(l − d)) − e(xy(l − r))}{r · e(xy(l − r)) − d · e(xy(l − d))}.

Solving for ∑_{j=1}^{∞} \frac{x^{j}y}{1−x^{j}y(ℓ−d)} ∏_{i=1}^{j−1} \frac{1−x^{i}y(ℓ−r)}{1−x^{i}y(ℓ−d)}, we obtain the desired result. □

We now turn to the proof of Theorem 2.1.

Proof. In order to find the two generating functions, we derive recursions for (palindromic) compositions that start with specific parts. Thus, we define a second set of generating functions

C_{A}(s_{1}s_{2} … s_{e}|x; y; r, ℓ, d) = ∑_{n≥0} ∑_{σ} x^{n}y^{parts(σ)}r^{rises(σ)}ℓ^{levels(σ)}d^{drops(σ)}

and

P_{A}(s_{1}s_{2} … s_{e}|x; y; r, ℓ, d) = ∑_{n≥0} ∑_{σ} x^{n}y^{parts(σ)}r^{rises(σ)}ℓ^{levels(σ)}d^{drops(σ)},

where the sum on the right side of the equation is over all the composition σ ∈ C_{n}^{A} and σ ∈ P_{n}^{A}, respectively, such that the (palindromic) composition σ starts with s_{1}s_{2} … s_{e}, for e ≥ 1. From the definitions of the generating functions, we immediately have the following:

C_{A}(x; y; r, ℓ, d) = 1 + ∑_{i=1}^{k} C_{A}(a_{i}|x; y; r, ℓ, d)  (1)

P_{A}(x; y; r, ℓ, d) = 1 + ∑_{i=1}^{k} P_{A}(a_{i}|x; y; r, ℓ, d),  (2)

where the summand 1 covers the case n = 0. The strategy is now to find expressions for the generating functions C_{A}(a_{i}|x; y; r, ℓ, d) and P_{A}(a_{i}|x; y; r, ℓ, d), which will allow us to prove the claim.

We will first prove part (1) of the theorem. We derive a recursion for C_{A}(a_{i}|x; y; r, ℓ, d) which together with Equation (1) gives a system of equations that is solved using Cramer’s rule. Note that the compositions of n starting with a_{i} with at least two parts can be created recursively by prepending a_{i} to a composition of n − a_{i} which starts with a_{j} for some j. This either creates a rise (if i < j), a level (if i = j), or a drop (if i > j), and in each case, results in one more part. Thus,

C_{A}(a_{i}a_{j}|x; y; r, ℓ, d) = \{ \begin{matrix}r x^{a_{i}}y C_{A}(a_{j}|x; y; r, ℓ, d), & i < j \\ ℓ x^{a_{i}}y C_{A}(a_{j}|x; y; r, ℓ, d), & i = j \\ d x^{a_{i}}y C_{A}(a_{j}|x; y; r, ℓ, d), & i > j \end{matrix} .

Summing over j and accounting for the single composition with exactly one part, namely a_{i}, gives

C_{A}(a_{i}|x; y; r, ℓ, d) = x^{a_{i}}y + x^{a_{i}}y d ∑_{j=1}^{i−1} C_{A}(a_{j}|x; y; r, ℓ, d) + x^{a_{i}}y ℓ C_{A}(a_{i}|x; y; r, ℓ, d)

+ x^{a_{i}}y r ∑_{j=i+1}^{k} C_{A}(a_{j}|x; y; r, ℓ, d)  (3)

for i = 1, 2, …, k. Let t_{0} = C_{A}(x; y; r, ℓ, d), t_{i} = C_{A}(a_{i}|x; y; r, ℓ, d) and b_{i} = x^{a_{i}}y, for i = 1, 2, …, k. Then Equations (1) and (3) result in this system of k + 1 equations in k + 1 variables:

( \begin{matrix}1 & −1 & −1 & ⋯ & −1 & −1 & −1 \\ 0 & 1 − b_{1}ℓ & −b_{1}r & −b_{1}r & ⋯ & −b_{1}r & −b_{1}r \\ 0 & −b_{2}d & 1 − b_{2}ℓ & −b_{2}r & ⋯ & −b_{2}r & −b_{2}r \\ 0 & −b_{3}d & −b_{3}d & 1 − b_{3}ℓ & ⋯ & −b_{3}r & −b_{3}r \\ ⋮ & & & ⋮ & & & ⋮ \\ 0 & −b_{k−1}d & −b_{k−1}d & −b_{k−1} & ⋯ & 1 − b_{k−1}ℓ & −b_{k−1}r \\ 0 & −b_{k}d & −b_{k}d & −b_{k}d & ⋯ & −b_{k}d & 1 − b_{k}ℓ \end{matrix} ) · ( t_{0} ; t_{1} ; t_{2} ; t_{4} ; ⋮ ; t_{k−1} ; t_{k} ) = ( 1 ; b_{1} ; b_{2} ; b_{3} ; ⋮ ; b_{k−1} ; b_{k} )

By Cramer’s rule, t_{0} = \frac{det(N_{k})}{det(M_{k})}, where M_{k} is the (k + 1) × (k + 1) matrix of the system of equations and N_{k} is the (k + 1) × (k + 1) matrix which results from replacing the first column in M_{k} by the vector of the right-hand side of the system, i.e.,

N_{k} = ( \begin{matrix}1 & −1 & −1 & ⋯ & −1 & −1 & −1 \\ b_{1} & 1 − b_{1}ℓ & −b_{1}r & −b_{1}r & ⋯ & −b_{1}r & −b_{1}r \\ b_{2} & −b_{2}d & 1 − b_{2}ℓ & −b_{2}r & ⋯ & −b_{2}r & −b_{2}r \\ b_{3} & −b_{3}d & −b_{3}d & 1 − b_{3}ℓ & ⋯ & −b_{3}r & −b_{3}r \\ ⋮ & & & ⋮ & & & ⋮ \\ b_{k−1} & −b_{k−1}d & −b_{k−1}d & −b_{k−1} & ⋯ & 1 − b_{k−1}ℓ & −b_{k−1}r \\ b_{k} & −b_{k}d & −b_{k}d & −b_{k}d & ⋯ & −b_{k}d & 1 − b_{k}ℓ \end{matrix} ) .

We now derive formulas for det(N_{k}) and det(M_{k}). Expanding down the first column of M_{k}, we get that

det(M_{k}) = | \begin{matrix}1 − b_{1}ℓ & −b_{1}r & −b_{1}r & ⋯ & −b_{1}r & −b_{1}r \\ −b_{2}d & 1 − b_{2}ℓ & −b_{2}r & ⋯ & −b_{2}r & −b_{2}r \\ −b_{3}d & −b_{3}d & 1 − b_{3}ℓ & ⋯ & −b_{3}r & −b_{3}r \\ ⋮ & & & ⋮ & & ⋮ \\ −b_{k−1}d & −b_{k−1}d & −b_{k−1} & ⋯ & 1 − b_{k−1}ℓ & −b_{k−1}r \\ −b_{k}d & −b_{k}d & −b_{k}d & ⋯ & −b_{k}d & 1 − b_{k}ℓ \end{matrix} | .

Subtracting the (k − 1)^{st} column from the k^{th} column of the above matrix, then expanding down the resulting column gives

det(M_{k}) = (1 − b_{k}(ℓ − d)) det(M_{k−1}) − b_{k}d(1 − b_{k−1}(ℓ − r)) det(E(b_{1}, b_{2}, ..., b_{k−2})), (4)

where

E(b_{1}, b_{2}, ..., b_{k−2}) = ( \begin{matrix}1 − b_{1}ℓ & −b_{1}r & −b_{1}r & ⋯ & −b_{1}r \\ −b_{2}d & 1 − b_{2}ℓ & −b_{2}r & ⋯ & −b_{2}r \\ −b_{3}d & −b_{3}d & 1 − b_{3}ℓ & ⋯ & −b_{3}r \\ ⋮ & & ⋮ & & ⋮ \\ −b_{k−2}d & −b_{k−2}d & −b_{k−2}d & ⋯ & −b_{k−2}r \\ 1 & 1 & 1 & ⋯ & 1 \end{matrix} ) .

Adding (b_{1}r) times the last row to the first row in the matrix E(b_{1}, b_{2}, ..., b_{k−2}), then expanding across the resulting first row gives

det(E(b_{1}, b_{2}, ..., b_{k−2})) = (1 − b_{1}(ℓ − r)) det(E(b_{2}, ..., b_{k−2})),

and, since det(E(b_{k−2})) = (1 − b_{k−2}(ℓ − r)),

det(E(b_{1}, b_{2}, ..., b_{k−2})) = ∏_{j=1}^{k−2}(1 − b_{j}(ℓ − r)).  (5)

Equations (4) and (5) result in

det(M_{k}) = (1 − b_{k}(ℓ − d)) det(M_{k−1}) − b_{k}d ∏_{j=1}^{k−1}(1 − b_{j}(ℓ − r)).

Thus, if we define det(M_{0}) = 1 and use the fact that det(M_{1}) = 1 − b_{1}ℓ = 1 − b_{1}(ℓ − d) − b_{1}d, then we can show by induction on k that for all k ≥ 1,

det(M_{k}) = ∏_{j=1}^{k}(1 − b_{j}(ℓ − d)) − d ∑_{j=1}^{k} b_{j} ∏_{i=1}^{j−1}(1 − b_{i}(ℓ − r)) ∏_{i=j+1}^{k}(1 − b_{j}(ℓ − d)).  (6)

Similarly, by subtracting (b_{k}d) times the last row from the k^{th} row in the matrix N_{k} and then expanding across the resulting k^{th} row we get

det(N_{k}) = (1 − b_{k}(ℓ − d)) det(N_{k−1}) + b_{k}(1 − d) det(D(b_{1}, b_{2}, ..., b_{k−1})),

where D(b_{1}, b_{2}, ..., b_{k−1}) agrees with E(b_{1}, b_{2}, ..., b_{k−1}) except for the signs of the last row. Thus, det(D(b_{1}, b_{2}, ..., b_{k−1})) = − det(E(b_{1}, b_{2}, ..., b_{k−1})), which yields

det(N_{k}) = (1 − b_{k}(ℓ − d)) det(N_{k−1}) − b_{k}(1 − d) ∏_{j=1}^{k−1}(1 − b_{j}(ℓ − r)).

With det(N_{0}) = 1 and det(N_{1}) = 1 − b_{1}ℓ + b_{1} = 1 − b_{1}(ℓ − d) + (1 − d)b_{1}, we can show by induction on k that for all k ≥ 1,

det(N_{k}) = ∏_{j=1}^{k}(1 − b_{j}(ℓ − d)) + (1 − d) ∑_{j=1}^{k} b_{j} ∏_{i=1}^{j−1}(1 − b_{i}(ℓ − r)) ∏_{i=j+1}^{k}(1 − b_{j}(ℓ − d)). (7)

Substituting Equations (6) and (7) and b_{i} = x^{a_{i}}y into \frac{det(N_{k})}{det(M_{k})} completes the proof of Theorem 2.1(1). Note that if |A| = ∞, then the result follows by taking limits as k → ∞.

We now prove part(2), which uses the same general idea of first deriving a recursion for P_{A}(a_{i}|x; y; r, ℓ, d) and then solving the resulting system of equations. Palindromes of n that start with a_{i} (for a fixed i) either have one part, a_{i}, or two parts and one level, a_{i}a_{i}, or three or more parts. Those of three or more parts can be created by adding the part a_{i} both at the beginning and the end of a palindromic composition of n − 2a_{i} that starts with a_{j}. If i = j, then two additional levels are created; if i ≠ j, then a rise and a drop are created, and in both cases we have two additional parts. Thus, the generating function is as follows:

P_{A}(a_{i}|x; y; r, ℓ, d) = x^{a_{i}}y + x^{2a_{i}}y^{2}ℓ + x^{2a_{i}}y^{2}ℓ^{2}P_{A}(a_{i}|x; y; r, ℓ, d)
+x^{2a_{i}}y^{2}d r ∑_{j≠i,j=1}^{k} P_{A}(a_{j}|x; y; r, ℓ, d)
= x^{a_{i}}y + x^{2a_{i}}y^{2}ℓ + x^{2a_{i}}y^{2}(ℓ^{2} − r d)P_{A}(a_{i}|x; y; r, ℓ, d)
+x^{2a_{i}}y^{2}d r(P_{A}(x; y; r, l, d) − 1),

where the last equality follows from Equation (2). We can now solve for P_{A}(a_{i}|x; y; r, ℓ, d), and substitute the result into Equation (2), which gives that

P_{A}(x; y; r, ℓ, d) = \frac{1 + ∑_{i=1}^{k} \frac{x^{a_{i}}y+x^{2a_{i}}y^{2}(ℓ−dr)}{1−x^{2a_{i}}y^{2}(ℓ^{2}−dr)}}{1 − ∑_{i=1}^{k} \frac{x^{2a_{i}}y^{2}dr}{1−x^{2a_{i}}y^{2}(ℓ^{2}−dr)}} .

The reason that we get a less tedious proof for palindromic compositions comes from the fact that we only need to distinguish between the cases i = j and i ≠ j when deriving P_{A}(a_{i}|x; y; r, ℓ, d). This allows us to solve for P_{A}(a_{i}|x; y; r, ℓ, d) in terms of P_{A}(x; y; r, ℓ, d), and allows for direct substituion. □

We now apply Theorem 2.1 to specific sets A to obtain previous and new results.

3. Results for compositions with parts in A

In this section we study the number of compositions of n as well as the number of rises, levels, and drops in the compositions of n with parts in A, both for general and specific sets A.

Applying Theorem 2.1(1) for r = ℓ = d = 1, we get that the generating function for the number of compositions of n with m parts in A is given by

\frac{1}{1 − y ∑_{j=1}^{k} x^{a_{j}}} .  (8)

Therefore, the generating function for the number of compositions of n with m parts in ℕ is given by

∑_{n≥0} ∑_{σ∈C_{n}^{ℕ}} x^{n}y^{parts(σ)} = \frac{1}{1 − y ∑_{j=1}^{∞} x^{j}} = \frac{1}{1 − \frac{y x}{1−x}} = ∑_{m≥0} \frac{x^{m}}{(1 − x)^{m}} y^{m}.

Furthermore, setting y = 1 in Equation (8) gives the generating function for the number of compositions of n with parts in A (see [12], Theorem 2.4):

\frac{1}{1 − ∑_{j=1}^{k} x^{a_{j}}} .

In particular, for A = ℕ, the generating function for the number of compositions of n with parts in ℕ is given by (see [5], Theorem 6)

\frac{1 − x}{1 − 2x}.

Additional examples for specific choices of A are given in [12]. We now state results concerning the number of rises and drops.

3.1 The number of rises and drops

Note that the number of rises equals the number of drops in all compositions of n: for each non-palindromic composition there exists a composition in reverse order, thus the rises match the drops, and for palindromic compositions, symmetry matches up rises and drops within the composition. Thus, we will derive results only for rises, and the results for drops follow by interchanging the roles of r and d in the proofs.

In order to obtain the relevant generating functions, we use a common technique, namely taking partial derivatives. Setting ℓ = d = 1 in Theorem 2.1(1) gives

C_{A}(x; y; r, 1, 1) = \frac{1}{1 − ∑_{j=1}^{k} (x^{a_{j}}y ∏_{i=1}^{j−1}(1 − x^{a_{i}}y(1 − r)))}.  (9)

Using Equation (9) together with the fact that for f_{i}(r) ≠ 0

\frac{∂}{∂r} ∏_{i=1}^{m} f_{i}(r) = (∏_{i=1}^{m} f_{i}(r)) ∑_{i=1}^{m} \frac{\frac{∂}{∂r}f_{i}(r)}{f_{i}(r)},  (10)

we get that

∑_{n≥0} ∑_{σ∈C_{n}^{A}} rises(σ)x^{n}y^{parts(σ)} = \frac{∂}{∂r}C_{A}(x; y; r, 1, 1)|_{r=1} = \frac{y^{2} ∑_{k≥j>i≥1} x^{a_{i}+a_{j}}}{(1 − y ∑_{j=1}^{k} x^{a_{j}})^{2}} .

Hence, expressing this function as a power series about y = 0, we get the following result.

Corollary 3.1 Let A = {a_{1}, …, a_{k}} be any ordered subset of ℕ. Then

∑_{n≥0} ∑_{σ∈C_{n}^{A}} rises(σ)x^{n}y^{parts(σ)} = ( ∑_{k≥j>i≥1} x^{a_{i}+a_{j}}) ∑_{m≥0}(m + 1) (∑_{j=1}^{k} x^{a_{j}})^{m} y^{m+2}

and

∑_{n≥0} ∑_{σ∈C_{n}^{A}} drops(σ)x^{n}y^{parts(σ)} = ( ∑_{k≥j>i≥1} x^{a_{i}+a_{j}}) ∑_{m≥0}(m + 1) (∑_{j=1}^{k} x^{a_{j}})^{m} y^{m+2}.

For example, letting A = ℕ and looking at the coefficient of y^{m} in Corollary 3.1 we get that the generating function for the number of rises (drops) in the compositions of n with a fixed number of parts, m ≥ 2, in ℕ is given by

∑_{j>i≥1} x^{i+j}(m − 1) (∑_{j≥1} x^{j})^{m−2}

= ∑_{i≥1} ∑_{j≥i+1} x^{i+j}(m − 1) (\frac{x}{1 − x})^{m−2} = ∑_{i≥1} x^{i} ∑_{j≥1} x^{2j} \frac{(m − 1)x^{m−2}}{(1 − x)^{m−2}}

= \frac{x^{3}}{(1 − x)(1 − x^{2})} · \frac{(m − 1)x^{m−2}}{(1 − x)^{m−2}} = \frac{(m − 1)x^{m+1}}{(1 + x)(1 − x)^{m}} .

Furthermore, setting y = 1 and A = ℕ in Corollary 3.1 allows us to compute the generating function for the number of rises (drops) in all compositions of n with parts in ℕ (see [5], Theorem 6) in a similar way:

∑_{n≥0} ∑_{σ∈C_{n}^{A}} rises(σ)x^{n} = ∑_{j>i≥1} x^{i+j} ∑_{m≥0}(m + 1) (\frac{x}{1 − x})^{m} = \frac{x^{3}}{(1 − x)(1 − x^{2})} · \frac{1}{(1 − \frac{x}{1−x})^{2}}

= \frac{x^{3}}{(1 + x)(1 − 2x)^{2}} .

For A = {1, k} and y = 1, Corollary 3.1 gives the generating function for the number of rises (drops) in all compositions of n with parts in {1, k} as (see [7], Theorem 4)

\frac{x^{k+1}}{(1 − x − x^{k})^{2}} .

For A = {m | m = 2k + 1, k ≥ 0} and y = 1, and using that ∑_{0≤i<j} x^{(2i+1)+(2j+1)} = ∑_{i≥0}(x^{2})^{i} ∑_{j≥1}(x^{4})^{j}, Corollary 3.1 yields a new result, namely that the generating function for the number of rises (drops) in compositions of n with odd parts is given by

\frac{x^{k+1}}{(1 − x − x^{k})^{2}} .

We also obtain new results for A = ℕ − {k} (studied in [6]) and A = ℕ − {1} (studied in [9]). For A = ℕ − {k}, we define g(x, y; k) = ∑_{n≥0} ∑_{σ∈C_{n}^{A}} rises(σ)x^{n}y^{parts(σ)}. Then Corollary 3.1 gives

g(x, y; k) = (\frac{x^{3}}{(1 − x)(1 − x^{2})} − \frac{x^{k+1}(1 − x^{k−1}) + x^{2k+1}}{1 − x} ) ∑_{m≥0}(m + 1) (\frac{x}{1 − x} − x^{k})^{m} y^{m+2}.

For k = 1, i.e., A = ℕ − {1} this expression reduces to

g(x, y; 1) = ∑_{m≥2}(m − 1)\frac{x^{2m+1}}{(1 + x)(1 − x)^{m}} y^{m}.

Thus, the generating function for the number of rises (drops) in the compositions of n without 1s with a fixed number of parts (m ≥ 2) is given by

(m − 1)\frac{x^{2m+1}}{(1 + x)(1 − x)^{m}} = ∑_{n≥0} x^{n+2m−1}(m − 1) ∑_{j=0}^{n}(−1)^{n−j}\binom{j + m − 1}{m − 1}.

We now look at results concerning levels.

3.2 The number of levels

Proceeding similarly to the case of rises, we set r = d = 1 in Theorem 2.1(1) to get

C_{A}(x; y; 1, ℓ, 1) = \frac{1}{1 − ∑_{j=1}^{k} \frac{x^{a_{j}} y}{1−x^{a_{j}} y(ℓ−1)}} .

Therefore,

∑_{n≥0} ∑_{σ∈C_{n}^{A}} levels(σ)x^{n}y^{parts(σ)} = \frac{∂}{∂ℓ}C_{A}(x; y; 1, ℓ, 1)|_{ℓ=1} = \frac{y^{2} ∑_{j=1}^{k} x^{2a_{j}}}{(1 − y ∑_{j=1}^{k} x^{a_{j}})^{2}} .

Expressing the above function as a power series about y = 0, we get the following result.

Corollary 3.2 Let A = {a_{1}, …, a_{k}} be any ordered subset of ℕ. Then

∑_{n≥0} ∑_{σ∈C_{n}^{A}} levels(σ)x^{n}y^{parts(σ)} = (∑_{j=1}^{k} x^{2a_{j}}) ∑_{m≥0}(m + 1) (∑_{j=1}^{k} x^{a_{j}})^{m} y^{m+2}.

Using computations similar to those for rises and drops, by looking at the coefficient of y^{m}, we get from Corollary 3.2 that the generating function for the number of levels in all compositions of n with a fixed number of parts m in ℕ is given by

\frac{(m − 1)x^{m}}{(1 + x)(1 − x)^{m−1}} .

In addition, by setting y = 1 and A = ℕ in Corollary 3.2 we obtain that the generating function for the number of levels in the compositions of n with parts in ℕ (see [5], Theorem 6) is given by

\frac{x^{2}(1 − x)}{(1 + x)(1 − 2x)^{2}} .

Applying Corollary 3.2 for A = {1, 2} and y = 1, we get the result given in Theorem 1.1 [1] for the generating function for the number of levels in all compositions with only 1’s and 2’s:

\frac{x^{2} + x^{4}}{(1 − (x + x^{2}))^{2}} ,

and more generally, for A = {1, k} and y = 1, we obtain the generalization stated in Theorem 4 [7]:

\frac{x^{2} + x^{2k}}{(1 − (x^{k} + x^{2k}))^{2}} .

If we apply Corollary 3.2 to A = {m | m = 2k + 1, k ≥ 0}, then we get a new result, namely that the generating function for the number of levels in the compositions of n with odd summands is given by

\frac{x^{2}(1 − x^{2})}{(1 + x^{2})(1 − x − x^{2})^{2}} .

Finally, we look at A = ℕ−{k} and define g(x, y; k) = ∑_{n≥0} ∑_{σ∈C_{n}^{A}} levels(σ)x^{n}y^{parts(σ)}. Then Corollary 3.2 gives

g(x, y; k) = (\frac{x^{2}}{1 − x^{2}} − x^{2k}) ∑_{m≥0}(m + 1) (\frac{x}{1 − x} − x^{k})^{m} y^{m+2}.

If we set y = 1, then we get a new result, namely that the generating function for the number of levels in the compositions of n without k is given by

\frac{(1 − x)x^{2}(1 − x^{2(k−1)} + x^{2k})}{(1 + x)(1 − 2x + x^{k} − x^{k+1})^{2}} .

4. Results for palindromic compositions with parts in A

Applying Theorem 2.1(2) for r = ℓ = d = 1 we get that the generating function for the number of palindromic compositions of n with m parts in A is given by

\frac{1 + y ∑_{i=1}^{k} x^{a_{i}}}{1 − y^{2} ∑_{i=1}^{k} x^{2a_{i}}} .

Setting y = 1 we get that the number of palindromic compositions of n with parts in A is given by (see [12], Theorem 3.2)

\frac{1 + ∑_{i=1}^{k} x^{a_{i}}}{1 − ∑_{i=1}^{k} x^{2a_{i}}} .

Using A = ℕ we get that the generating function for the number of palindromic compositions of n with parts in ℕ is given by (see [5], Theorem 6)

\frac{1 + x}{1 − 2x^{2}} .

We now turn our attention to the number of rises and drops.

4.1 The number of rises and drops

As before, the number of rises equals the number of drops. Theorem 2.1(2) for ℓ = 1 and d = 1 gives

P_{A}(x; y; r, 1, 1) = \frac{1 + ∑_{i=1}^{k} \frac{x^{a_{i}}y+x^{2a_{i}}y^{2}(1−r)}{1−x^{2a_{i}}y^{2}(1−r)}}{1 − ∑_{i=1}^{k} \frac{x^{2a_{i}}y^{2}r}{1−x^{2a_{i}}y^{2}(1−r)}} .

Therefore, by finding \frac{∂}{∂r}P_{A}(x; y; r, 1, 1) and setting r = 1 we obtain the following result.

Corollary 4.1 Let A = {a_{1}, …, a_{k}} be any ordered subset of ℕ. Then the generating function g_{A}(x; y) = ∑_{n≥0} ∑_{σ∈P_{n}^{A}} rises(σ)x^{n}y^{parts(σ)} = ∑_{n≥0} ∑_{σ∈P_{n}^{A}} drops(σ)x^{n}y^{parts(σ)} is given by

\frac{y^{2} (1 + y ∑_{i=1}^{k} x^{a_{i}}) (∑_{i=1}^{k} x^{2a_{i}}(1 − x^{2a_{i}}y^{2})) − y^{2} (1 − y^{2} ∑_{i=1}^{k} x^{2a_{i}}) ∑_{i=1}^{k} x^{2a_{i}}(1 + x^{a_{i}}y)}{(1 − y^{2} ∑_{i=1}^{k} x^{2a_{i}})^{2}}.

For example, if A = ℕ, then Corollary 4.1 gives that

g_{ℕ}(x; y) = \frac{y^{2} (1 + \frac{yx}{1−x}) (\frac{x^{2}}{1−x^{2}} − \frac{x^{4}y^{2}}{1−x^{4}} )) − y^{2} (1 − \frac{y^{2}x^{2}}{1−x^{2}} ) (\frac{x^{2}}{1−x^{2}} + \frac{x^{3}y}{1−x^{3}} )}{(1 − \frac{y^{2}x^{2}}{1−x^{2}} )^{2}}.  (11)

Thus, we can derive the generating function for the number of rises (drops) in the compositions of n with a given number of parts, m, in ℕ, by looking at the coefficient of y^{m} in g_{ℕ}(x; y). To do so, we expand the numerator of g_{ℕ}(x; y) and collect terms according to powers of y:

\frac{x^{4}y^{3}}{(1 − x)^{2}(1 + x)} · (\frac{2x + 1}{(x^{2} + x + 1)} + \frac{2x^{2}}{(x + 1)(x^{2} + 1)}y − \frac{x^{2}}{(x^{2} + x + 1)(x^{2} + 1)}y^{2}) .

Furthermore,

\frac{1}{(1 − \frac{y^{2}x^{2}}{1−x^{2}} )^{2}} = ∑_{m≥0} \frac{(m + 1)x^{2m}}{(1 − x^{2})^{m}} y^{2m},

so altogether,

g_{ℕ}(x; y) = ∑_{m≥0} \frac{(m + 1)x^{2m+4}}{(1 − x)^{2}(1 + x)(1 − x^{2})^{m}} y^{2m+3} ·

(\frac{2x + 1}{(x^{2} + x + 1)} + \frac{2x^{2}}{(x + 1)(x^{2} + 1)}y − \frac{x^{2}}{(x^{2} + x + 1)(x^{2} + 1)}y^{2}) .

We now have to distinguish between two cases, namely, m even and m odd. In the first case, only the summand with factor y (resulting in terms with factor y^{2m+3}y) needs to be taken into account, whereas in the second case, the summands with factors y^{0} and y^{2} (resulting in terms with factors y^{2m+3} and y^{2m+3}y^{2}) need to be considered. Thus, the generating function for the number of rises (drops) in the compositions of n with a given number of parts, m, in ℕ is given by

\frac{(2m′ − 2)x^{2m′+2}}{(1 + x^{2})(1 − x^{2})^{m′}} for m = 2m′,

and

\frac{x^{2m′}(1 − x)(1 + (2m′ − 2)x + (2m′ − 3)x^{2} + (2m′ − 2)x^{3})}{(1 + x^{2})(1 + x + x^{2})(1 − x^{2})^{m′}} for m = 2m′ − 1.

Furthermore, setting y = 1 in Equation (11) and simplifying yields that the generating function for the number of rises (drops) in the compositions of n with parts in ℕ (see [5], Theorem 6) is given by

g_{ℕ}(x; 1) = \frac{x^{4}(4x^{4} + 4x^{3} + 4x^{2} + 3x + 1)}{(1 + x^{2})(1 + x + x^{2})(1 − 2x^{2})^{2}} .

We now apply Corollary 4.1 for A = {1, k} and get that

g_{\{1,k\}}(x; y) = \frac{x^{k+1}y^{3}(x + x^{k} + 2x^{k+1}y − y^{2}(x^{3} + x^{3k} − x^{k+2} − x^{2k+1}))}{(1 − y^{2}(x^{2} + x^{2k}))^{2}}.

In particular, when setting y = 1 in the above expression we get that the generating function for the number of rises (drops) in the palindromic compositions of n with any number of parts in A = {1, k} is given by (see [7], Theorem 5)

g_{\{1,k\}}(x; 1) = \frac{x^{k+1}(x − x^{3} + x^{k} − x^{3k} + 2x^{k+1} + x^{k+2} + x^{2k+1})}{(1 − x^{2} − x^{2k})^{2}}.

If we let A = {m | m = 2k + 1, k ≥ 0} in Corollary 4.1, then we get that the generating function g_{A}(x; y) is given by

\frac{y^{2} (1 + \frac{x y}{1−x^{2}} ) (\frac{x^{2}}{1−x^{4}} − \frac{y^{2}x^{4}}{1−x^{8}} ) − y^{2} (1 − \frac{x^{2}y^{2}}{1−x^{4}} ) (\frac{x^{2}}{1−x^{4}} + \frac{x^{3}y}{1−x^{6}} )}{(1 − \frac{x^{2}y^{2}}{1−x^{4}} )^{2}}.

Furthermore, if we set y = 1 in the above expression, then we get that the generating function for the number of rises (drops) in the palindromic compositions of n with any number of odd parts is given by

g_{A}(x; 1) = \frac{x^{5}(1 + 2x^{2} + 2x^{3} + 2x^{4} + 2x^{5} + 3x^{6} + 2x^{7} + 2x^{8})}{(1 + x^{4})(1 − x^{2} − x^{4})^{2}(1 + x^{2} + x^{4})},

which extends the work of Grimaldi [10].

Applying Corollary 4.1 to A = ℕ − {k} gives that

g_{ℕ−\{k\}}(x; y) = \frac{y^{2} (1 + \frac{yx}{1−x} − yx^{k}) (\frac{x^{2}}{1−x^{2}} − x^{2k} − \frac{y^{2}x^{4}}{1−x^{4}} + y^{2}x^{4k})}{(1 − \frac{y^{2}x^{2}}{1−x^{2}} + y^{2}x^{2k})^{2}}

− \frac{y^{2} (1 − \frac{y^{2}x^{2}}{1−x^{2}} + y^{2}x^{2k}) (\frac{x^{2}}{1−x^{2}} − x^{2k} + \frac{yx^{3}}{1−x^{3}} − yx^{3k})}{(1 − \frac{y^{2}x^{2}}{1−x^{2}} + y^{2}x^{2k})^{2}}.

In particular, when setting y = 1 in the above expression we get that the generating function for the number of rises (drops) in the palindromic compositions of n with any number of parts in A = ℕ − {k} is given by

g_{ℕ−\{k\}}(x; 1) = \frac{x^{4}(1 + 3x + 4x^{2} + 4x^{3} + 4x^{4}) + x^{2k+1}(x^{4} − 1)(1 + 4x + 5x^{2} + 4x^{3})}{(1 + x^{2})(1 + x + x^{2})(1 − 2x^{2} + x^{2k} − x^{2(k+1)})^{2}}

+\frac{(x^{2} − 1)(x^{k+2} + x^{3k}(1 + x^{2})(3x^{2} − 2) + x^{4k}(1 + x)(x − 2))}{(1 + x^{2})(1 − 2x^{2} + x^{2k} − x^{2(k+1)})^{2}}.

This extends the work of Chinn and Heubach [6]. Likewise, we can extend the work of Grimaldi [9] by setting k = 1 to get that

g_{ℕ−\{1\}}(x; 1) = \frac{(x^{5} + 3x^{4} + 5x^{3} + 3x^{2} + 3x + 1)x^{7}}{(1 − x^{2} − x^{4})^{2}(1 + x + x^{2})(1 + x^{2})}.

We now look at the number of levels in palindromic compositions.

4.2 The number of levels

Theorem 2.1(2) for r = d = 1 gives

P_{A}(x; y; 1, ℓ, 1) = \frac{1 + ∑_{i=1}^{k} \frac{x^{a_{i}}y+x^{2a_{i}}y^{2}(ℓ−1)}{1−x^{2a_{i}}y^{2}(ℓ^{2}−1)}}{1 − ∑_{i=1}^{k} \frac{x^{2a_{i}}y^{2}}{1−x^{2a_{i}}y^{2}(ℓ^{2}−1)}} .

Therefore, finding \frac{∂}{∂ℓ}P_{A}(x; y; 1, ℓ, 1) and setting ℓ = 1 yields the following result.

Corollary 4.2 Let A = {a_{1}, …, a_{k}} be any ordered subset of ℕ. Then the generating function g_{A}(x; y) = ∑_{n≥0} ∑_{σ∈P_{n}^{A}} levels(σ)x^{n}y^{parts(σ)} is given by

\frac{y^{2} (1 − y^{2} ∑_{i=1}^{k} x^{2a_{i}}) ∑_{i=1}^{k} x^{2a_{i}}(1 + 2x^{a_{i}}y) + 2y^{4} (1 + y ∑_{i=1}^{k} x^{a_{i}}) ∑_{i=1}^{k} x^{4a_{i}}}{(1 − y^{2} ∑_{i=1}^{k} x^{2a_{i}})^{2}} .

For example, applying Corollary 4.2 for A = ℕ gives that the generating function g_{ℕ}(x; y) for the number of levels in all palindromic compositions of n with m parts in ℕ is given by

\frac{x^{2}y^{2}(2x^{4}(x + 1)y^{3} + x^{2}(1 − 3x^{2})(1 + x + x^{2})y^{2} + (1 − x^{4})(2x(1 + x)y + 1 + x + x^{2}))}{(1 + x^{2})(1 + x + x^{2})(1 − x^{2} − x^{2}y^{2})^{2}}. (12)

Since

\frac{1}{(1 − x^{2} − x^{2}y^{2})^{2}} = \frac{1}{(1 − x^{2})^{2}(1 − \frac{x^{2}y^{2}}{1−x^{2}} )^{2}} = \frac{1}{(1 − x^{2})^{2}} ∑_{m≥0}(m + 1)\frac{x^{2m}}{(1 − x^{2})^{m}} y^{2m},

we can compute the generating function l_{m}(x) for the number of levels in palindromic compositions of n with a given number of parts, m, by looking at the coefficient of y^{m} in expression (12):

l_{m}(x) = \{ \begin{matrix}\frac{x^{2}}{1−x^{2}} & for & m = 2 \\ \frac{(2m′−1−(2m′−3)x^{2})x^{2m′}}{(1+x^{2})(1−x^{2})^{m′}} & for & m = 2m′, m′ ≥ 2 \\ \frac{2(1+x)(m′+(m′−1)x+m′x^{2})x^{2m′+1}}{(1+x^{2})(1+x+x^{2})(1−x^{2})^{m′}} & for & m = 2m′ + 1, m′ ≥ 1 \end{matrix} .

In addition, setting y = 1 in (12) gives that the generating function for the number of levels in the palindromic compositions of n with parts in ℕ (see [5], Theorem 6) is given by

g_{ℕ}(x; 1) = \frac{x^{2}(1 + 3x + 4x^{2} + x^{3} − x^{4} − 4x^{5} − 6x^{6})}{(1 + x^{2})(1 + x + x^{2})(1 − 2x^{2})^{2}}.

If we let A = {1, k} in Corollary 4.2, then g_{{1,k}}(x; y) is given by

\frac{y^{2}(x^{2} + x^{2k}) + 2y^{3}(x^{3} + x^{3k}) + y^{4}(x^{4} + x^{4k} − 2x^{2(k+1)}) + 2y^{5}(x^{k+4} − x^{2k+3} − x^{3k+2} + x^{4k+1})}{(1 − y^{2}x^{2} − y^{2}x^{2k})^{2}}.

Setting y = 1 in the above expression yields that the generating function for the number of levels in the palindromic compositions of n with any number of parts in {1, k} is given by

g_{\{1,k\}}(x; 1) = \frac{x^{2} + x^{2k} + x^{3} + x^{3k} + x^{4} + x^{4k} + 2(x^{k+4} − x^{2(k+1)} − x^{2k+3} − x^{3k+2} + x^{4k+1})}{(1 − y^{2}x^{2} − y^{2}x^{2k})^{2}}.

This result was not explicitly stated in [7], but can be easily computed from the generating functions for other quantities given in [7].

We look next at A = {m | m = 2k + 1, k ≥ 0}. Applying Corollary 4.2 for this case, we get that

g_{A}(x; y) = \frac{y^{2} (1 − \frac{x^{2}y^{2}}{1−x^{4}} ) (\frac{x^{2}}{1−x^{4}} + 2\frac{x^{3}y}{1−x^{6}} ) + 2\frac{x^{4}y^{4}}{1−x^{8}} (1 + \frac{x y}{1−x^{2}} )}{(1 − \frac{x^{2}y^{2}}{1−x^{4}} )^{2}}.

Furthermore, if we set y = 1 in the above expression, then we get that the generating function for the number of levels in the palindromic compositions of n with any number of odd parts is given by

g_{A}(x; 1) = \frac{x^{2}(1 + 2x + 2x^{2} + 2x^{3} + 2x^{4} + 2x^{5} − 2x^{6} + 2x^{7} − 4x^{8} − 2x^{9} − 4x^{10} − 2x^{11} − x^{12})}{(1 + x^{4})(1 − x^{2} − x^{4})^{2}(1 + x^{2} + x^{4})},

which extends the work of Grimaldi [10].

Finally, applying Corollary 4.2 for A = ℕ − {k} gives that the generating function g_{ℕ−{k}}(x; y) is given by

\frac{y^{2} (1 − \frac{y^{2}x^{2}}{1−x^{2}} + y^{2}x^{2k}) (\frac{x^{2}}{1−x^{2}} − x^{2k} + \frac{2yx^{3}}{1−x^{3}} − 2yx^{3k}) + 2y^{4} (1 + \frac{yx}{1−x} − yx^{k}) (\frac{x^{4}}{1−x^{4}} − x^{4k})}{(1 − \frac{y^{2}x^{2}}{1−x^{2}} + y^{2}x^{2k})^{2}}.

In particular, when setting y = 1 in the above expression we get that the generating function for the number of levels in the palindromic compositions of n that do not contain k is given by

\frac{x^{2}(1 + 3x + 4x^{2} + x^{3} − x^{4} − 4x^{5} − 6x^{6}) + x^{2k}(x^{4} − 1)(1 + x − 2x^{2} − 5x^{3} − 5x^{4})}{(1 + x^{2})(1 + x + x^{2})(1 − 2x^{2} + x^{2k} − x^{2(k+1)})^{2}}

+\frac{(x^{2} − 1)(2x^{k+4} + 2x^{3k}(1 + x^{2})(1 − 2x^{2}) + x^{4k}(1 + x)(3 − x)(1 + x^{2}))}{(1 + x^{2})(1 − 2x^{2} + x^{2k} − x^{2(k+1)})^{2}}.

This extends the work of Chinn and Heubach [6]. Likewise, we can extend the work of Grimaldi [9] by setting k = 1 to get that

g_{ℕ−\{1\}}(x; 1) = \frac{(1 + x + 3x^{2} + 2x^{3} − 5x^{6} − 3x^{7} − x^{8})x^{4}}{(1 − x^{2} − x^{4})^{2}(1 + x^{2})(1 + x + x^{2})} .

In the next section, we look at another special type of compositions.

5. Results for Carlitz compositions with parts in A

A Carlitz composition^{1} of n, introduced in [3], is a composition of n in which no adjacent parts are the same. In other words, a Carlitz composition σ is a composition with levels(σ) = 0.

1Originally called waves by L. Carlitz in [3], and also known as Smirnov sequences (see [8], page 68).

Named Carlitz compositions by Knopfmacher and Prodinger in [13] in honor of L. Carlitz

Carlitz [2] specialized the general results for compositions with parts in A = ℕ to Carlitz compositions, but did not consider Carlitz palindromic compositions. Knopfmacher and Prodinger[13] stated results for the total number of Carlitz compositions without reference to the function e(u, x) defined in Corollary 2.2.

In this section, we will apply Theorem 2.1 to state general results for Carlitz compositions and Carlitz palindromic compositions, and also look at a few specific sets A. We denote the set of Carlitz compositions and Carlitz palindromic compositions of n with parts in A, respectively, by E_{n}^{A} and F_{n}^{A}. Note that F_{n}^{A} = E_{n}^{A} ∩ P_{n}^{A}.

5.1 The number of Carlitz compositions

Let E_{n}^{A} denote the set of Carlitz compositions of n with parts in A, and E_{A}(x; y; r, d) the generating function for the number of Carlitz compositions of n with m parts in A with respect to the number of rises and drops, i.e.,

E_{A}(x; y; r, d) = ∑_{n≥0} ∑_{σ∈E_{n}^{A}} x^{n}y^{parts(σ)}r^{rises(σ)}d^{drops(σ)}.

Since E_{A}(x; y; r, d) = C_{A}(x; y; r, 0, d), Theorem 2.1(1) for ℓ = 0 gives the following result.

Corollary 5.1 Let A = {a_{1}, …, a_{k}} be any ordered subset of ℕ. Then

E_{A}(x; y; r, d) = 1 + \frac{∑_{j=1}^{k} (\frac{x^{a_{j}}y}{1 + x^{a_{j}}y d} ∏_{i=1}^{j−1} \frac{1 + x^{a_{i}}y r}{1 + x^{a_{i}}y d})}{1 − ∑_{j=1}^{k} (\frac{x^{a_{j}}y d}{1 + x^{a_{j}}y d} ∏_{i=1}^{j−1} \frac{1 + x^{a_{i}}y r}{1 + x^{a_{i}}y d})}.

Note that equating E_{A}(x; y; r, d) with the result of Theorem 3 [2] gives Corollary 2.2 for ℓ = 0. We now look at specific sets A. Setting r = d = 1 in Corollary 5.1 we obtain the generating function for the number of Carlitz compositions with m parts in A (for the case A = ℕ, see [13]) as

E_{A}(x; y; 1, 1) = \frac{1}{1 − ∑_{j=1}^{k} \frac{x^{a_{j}} y}{1+x^{a_{j}} y}} .

Applying Corollary 5.1 for A = {a, b} and r = d = 1 yields the generating function for the number of Carlitz compositions of n with m parts in {a, b} is given by

\frac{(1 + x^{a}y)(1 + x^{b}y)}{1 − x^{a+b}y^{2}} = 1 + (x^{a} + x^{b})y + ∑_{m≥1} x^{m(a+b)}(2y^{2m} + (x^{a} + x^{b})y^{2m+1}).

In particular, setting y = 1 in the expression above yields that the generating function for the number of Carlitz compositions of n with parts in {a, b} is given by

\frac{(1 + x^{a})(1 + x^{b})}{1 − x^{a+b}}.

Remark: In the case A = {a, b}, the requirement that no adjacent parts are to be the same restricts the compositions to those with alternating a’s and b’s. This results in the following possibilities:

n  Carlitz compositions of n
n′(a + b)  abab … ab, baba … ba
n′(a + b) + a abab … aba (13)
n′(a + b) + b  babab … ab

Thus, the number of Carlitz compositions of n > 0 is 2 if n ≡ 0 (mod(a + b)), 1 if n ≡ a (mod(a + b)) or ≡ b (mod(a + b)), and 0 otherwise.

Next we look at the number of rises and drops in Carlitz compositions.

5.2 The number of rises and drops

As before, the number of rises equals the number of drops. Using Corollary 5.1 to find an explicit expression for \frac{∂}{∂r}E_{A}(x; y; r, 1)|_{r=1} gives the following result.

Corollary 5.2 Let A = {a_{1}, …, a_{k}} be any ordered subset of ℕ. Then the generating functions ∑_{n≥0} ∑_{σ∈E_{n}^{A}} rises(σ)x^{n}y^{parts(σ)} and ∑_{n≥0} ∑_{σ∈E_{n}^{A}} drops(σ)x^{n}y^{parts(σ)} are given by

∑_{j=1}^{k} (\frac{x^{a_{j}}y}{1 + x^{a_{j}}y} ∑_{i=1}^{j−1} \frac{x^{a_{i}}y}{1 + x^{a_{i}}y} ) /(1 − ∑_{j=1}^{k} \frac{x^{a_{j}}y}{1 + x^{a_{j}}y} )^{2} .

Setting A = ℕ and y = 1 in Corollary 5.2 yields that the generating function for the number of rises (drops) in the Carlitz compositions of n with parts in ℕ is given by

\begin{matrix}∑ & j≥1 & (\frac{x^{j}}{1+x^{j}} ∑{j−1 \atop i=1} \frac{x^{i}}{1+x^{i}} ) \\ (1 − ∑_{j≥1} \frac{x^{j}}{1+x^{j}} ) & 2 \end{matrix}.

Applying Corollary 5.2 for A = {a, b} gives that

∑_{n≥0} ∑_{σ∈E_{n}^{A}} rises(σ)x^{n}y^{parts(σ)} = \frac{x^{a+b}y^{2}(1 + x^{a}y)(1 + x^{b}y)}{(1 − x^{a+b}y^{2})^{2}}
= ∑_{m≥1} x^{m(a+b)} ((2m − 1)y^{2m} + m(x^{a} + x^{b})y^{2m+1}) ,

where the second equation follows after collecting even and odd powers of y.

In particular, setting y = 1 in the expression above yields that the generating function for the number of rises (drops) in the Carlitz compositions of n with parts in {a, b} is given by

\frac{x^{a+b}(1 + x^{a})(1 + x^{b})}{(1 − x^{a+b})^{2}}.

Thus, the number of rises (drops) in Carlitz compositions of n ≥ (a + b) with parts in {a, b} is given by

\{ \begin{matrix}2n′ − 1 & if n = (a + b)n′ for n′ ≥ 1 \\ n′ & if n = (a + b)n′ + a or n = (a + b)n′ + b \end{matrix} .

This follows immediately from (13) since there is a rise for every occurrence of “ab”. If n = (a + b)n′ and the composition starts with a, then there are n′ rises. For the composition that starts with b, there is one less rise, for a total of 2n′ − 1 rises. If n is not a multiple of a + b, then the composition starts with r, where n = (a + b)n′ + r. In either case, there are exactly n′ rises, as there are n′ occurrences of “ab” in the composition.

We now derive results for Carlitz palindromic compositions.

5.3 The number of Carlitz palindromic compositions

We denote the generating function for the number of Carlitz palindromic compositions of n with m parts in A with respect to the number of rises by F_{A}(x; y; r), that is,

F_{A}(x; y; r) = ∑_{n≥0} ∑_{σ∈F_{n}^{A}} x^{n}y^{parts(σ)}r^{rises(σ)}.

Note that F_{A}(x; y; r) = P_{A}(x; y; r, 0, 1). Using Theorem 2.1(2) for ℓ = 0 and d = 1 gives the following result.

Corollary 5.3 Let A = {a_{1}, …, a_{k}} be any ordered subset of ℕ. Then

F_{A}(x; y; r) = 1 + \frac{∑_{i=1}^{k} \frac{x^{a_{i}}y}{1+x^{2a_{i}}y^{2}r}}{1 − ∑_{i=1}^{k} \frac{x^{2a_{i}}y^{2}r}{1+x^{2a_{i}}y^{2}r}} .

Applying Corollary 5.3 for A = {a, b} and y = r = 1 yields that the generating function for the number of Carlitz palindromic compositions of n with parts in {a, b} is given by

\frac{1 + x^{a} + x^{b} − x^{a+b}}{1 − x^{a+b}} .

Thus, the number of Carlitz palindromic compositions of n with parts in {a, b} is 1 if n = (a + b)n′ + a or n = (a + b)n′ + b for some n′ ≥ 0, and 0 otherwise. This follows immediately from (13), since the Carlitz compositions for n = (a + b)n′ are not symmetric.

5.4 The number of rises and drops

We now study the number of rises (drops) in all Carlitz palindromic compositions of n with m parts in A. Using Corollary 5.3 to compute \frac{∂}{∂r}F_{A}(x; y; r)|_{r=1} gives the following result.

Corollary 5.4 Let A = {a_{1}, …, a_{k}} be any ordered subset of ℕ. Then the generating function for the number of rises in all Carlitz palindromic compositions of n with m parts in A is given by

\frac{∂}{∂r}F_{A}(x; y; r)|_{r=1} = \frac{∑_{i=1}^{k} \frac{x^{3a_{i}}y^{3}}{(1+x^{2a_{i}}y^{2})^{2}} (∑_{i=1}^{k} \frac{x^{2a_{i}}y^{2}}{1+x^{2a_{i}}y^{2}} − 1) + ∑_{i=1}^{k} \frac{x^{a_{i}}y}{1+x^{2a_{i}}y^{2}} ∑_{i=1}^{k} \frac{x^{2a_{i}}y^{2}}{(1+x^{2a_{i}}y^{2})^{2}}}{(1 − ∑_{i=1}^{k} \frac{x^{2a_{i}}y^{2}}{1+x^{2a_{i}}y^{2}} )^{2}} .

Applying Corollary 5.4 for A = {a, b} gives that

∑_{n≥0} ∑_{σ∈F_{n}^{A}} rises(σ)x^{n}y^{parts(σ)} = \frac{x^{a+b}y^{3}(x^{a} + x^{b})}{(1 − x^{a+b}y^{2})^{2}} = (x^{a} + x^{b}) ∑_{m≥1} m x^{m(a+b)}y^{2m+1}.

In particular, setting y = 1 in the expression above yields that the generating function for the number of rises (drops) in all Carlitz palindromic compositions of n with parts in {a, b} is given by

\frac{x^{a+b}(x^{a} + x^{b})}{(1 − x^{a+b})^{2}}.

Thus, the number of rises (drops) in the Carlitz palindromic compositions of n ≥ a + b with parts in {a, b} is given by

n′ if n = (a + b)n′ + a or n = (a + b)n′ + b for n′ ≥ 1 and 0 otherwise.

This follows immediately from (13), as the Carlitz compositions for n = (a + b)n′ + a and n = (a + b)n′ + b are symmetric.

Last, but not least, we apply Theorem 2.1 to obtain results for partitions.

6. Partitions with parts in A

A partition σ of n is a composition of n with rises(σ) = 0. Let G_{n}^{A} be the set of all partitions of n with parts in A.

6.1 The number of partitions

We denote the generating function for the number of partitions of n with m parts in A with respect to the number of levels and drops by

G_{A}(x; y; ℓ, d) = ∑_{n≥0} ∑_{σ∈G_{n}^{A}} x^{n}y^{parts(σ)}ℓ^{levelsσ}d^{drops(σ)}.

Note that G_{A}(x; y; ℓ, d) = C_{A}(x; y; 0, l, d). Using Theorem 2.1(1) for r = 0 we get the following result.

Corollary 6.1 Let A = {a_{1}, …, a_{k}} be any ordered subset of ℕ. Then the generating function G_{A}(x; y; ℓ, d) is given by

1 + \frac{∑{k \atop j=1} (\frac{x^{a_{j}} y}{1−x^{a_{j}} y(ℓ−d)} ∏{j−1 \atop i=1} \frac{1−x^{a_{i}}yℓ}{1−x^{a_{i}}y(ℓ−d)})}{1 − d ∑_{j=1}^{k} (\frac{x^{a_{j}} y}{1−x^{a_{j}} y(ℓ−d)} ∏_{i=1}^{j−1} \frac{1−x^{a_{i}}yℓ}{1−x^{a_{i}}y(ℓ−d)})}.

For example, if we apply Corollary 6.1 for A = ℕ and ℓ = d = 1 and use the identity

∑_{j=1}^{k} x^{a_{j}} ∏_{i=1}^{j−1}(1 − x^{a_{i}}α) = \frac{1}{α} (1 − ∏_{j=1}^{k}(1 − x^{a_{j}}α)) ,  (14)

then we get that the generating function for the number of partitions of n with m parts in A = ℕ is given by

F_{ℕ}(x; y; 1, 1) = ∏_{j≥1}(1 − x^{j}y)^{−1}.

Note that the identity in (14) follows from the fact that

1 − α ∑_{j=1}^{k} x^{a_{j}} ∏_{i=1}^{j−1}(1 − x^{a_{i}}α) = (1 − ∏_{j=1}^{k}(1 − x^{a_{j}}α)) ,

which can be easily proved by induction.

Another interesting example, namely setting ℓ = 0 and d = 1 in Corollary 6.1, gives that the generating function for the number of partitions of n with m parts in A in which no adjacent parts are the same, that is, the partitions with distinct parts, is given by

G_{A}(x; y; 0, 1) = \frac{1}{1 − ∑_{j=1}^{k} x^{a_{j}}y ∏_{i=1}^{j}(1 + x^{a_{i}}y)^{−1}} = ∏_{j=1}^{k}(1 + x^{a_{j}}y),

where the second equality is easily proved by induction. In particular, the generating function for the number of partitions of n with parts in ℕ with distinct parts is given by ∏_{j≥1}(1+x^{j}).

6.2 The number of levels and drops

We now study the number of levels and drops in all partitions of n. Using Corollary 6.1 to compute \frac{∂}{∂ℓ}G_{A}(x; y; ℓ, 1)|_{ℓ=1} and \frac{∂}{∂d}G_{A}(x; y; 1, d)|_{d=1}, we get the following result.

Corollary 6.2 Let A = {a_{1}, …, a_{k}} be any ordered subset of ℕ. Then the generating function ∑_{n≥0} ∑_{σ∈G_{n}^{A}} levels(σ)x^{n}y^{parts(σ)} is given by

\frac{∑_{j=1}^{k} (x^{2a_{j}}y^{2} ∏_{i=1}^{j−1}(1 − x^{a_{i}}y)) − ∑_{j=1}^{k} (x^{a_{j}}y ∏_{i=1}^{j−1}(1 − x^{a_{i}}y) ∑_{i=1}^{j−1} \frac{x^{2a_{i}}y^{2}}{1−x^{a_{i}}y})}{∏_{j=1}^{k}(1 − x^{a_{j}}y)^{2}},

and the generating function ∑_{n≥0} ∑_{σ∈G_{n}^{A}} drops(σ)x^{n}y^{parts(σ)} is given by

\frac{(1 − ∏_{j=1}^{k}(1 − x^{a_{j}}y))^{2} − y^{2} ∑_{j=1}^{k} (x^{a_{j}} ∏_{i=1}^{j−1}(1 − x^{a_{i}}y) ∑_{i=1}^{j} x^{a_{i}})}{∏_{j=1}^{k}(1 − x^{a_{j}}y)^{2}}.

Proof. We give a sketch of the proof for the first generating function. Since G_{A}(x; y; l, 1) = 1 + \frac{S(ℓ)}{1−S(ℓ)}, where

S(ℓ) = ∑_{j=1}^{k} (\frac{x^{a_{j}}y}{1 − x^{a_{j}}y(ℓ − 1)} ∏_{i=1}^{j−1} \frac{1 − x^{a_{i}}yℓ}{1 − x^{a_{i}}y(ℓ − 1)}) = ∑_{j=1}^{k} (g_{j}(ℓ) ∏_{i=1}^{j−1} f_{i}(ℓ)) ,

we get that

\frac{∂}{∂ℓ}G_{A}(x; y; ℓ, 1) = \frac{\frac{∂}{∂ℓ}S(ℓ)}{(1 − S(ℓ))^{2}} = \frac{∑_{j=1}^{k} \frac{∂}{∂ℓ}g_{j}(ℓ) ∏_{i=1}^{j−1} f_{i}(ℓ) + g_{j}(ℓ)\frac{∂}{∂ℓ} ∏_{i=1}^{j−1} f_{i}(ℓ)}{(1 − S(ℓ))^{2}}.

Using Equation (10) gives that \frac{∂}{∂ℓ} ∏_{i=1}^{j−1} f_{i}(ℓ) = − ∏_{i=1}^{k} f_{i}(ℓ) ∑_{j=1}^{k} \frac{x^{2a_{j}} y^{2}}{(1−x^{a_{j}} yℓ)(1−x^{a_{j}} y(ℓ−1))}. Computing \frac{∂}{∂ℓ}g_{j}(ℓ), setting ℓ = 1 in the expression for \frac{∂}{∂ℓ}G_{A}(x; y; ℓ, 1), then using Equation (14) to simplify the denominator gives the stated result. □

Applying Corollary 6.2 to A = {a, b} gives that the generating function for the number of levels and drops, respectively, in the partitions of n with m parts in {a, b} is given by

\frac{x^{2a}y^{2}(1 − x^{b}y) + x^{2b}y^{2}(1 − x^{a}y)}{(1 − x^{a}y)^{2}(1 − x^{b}y)^{2}}  and  \frac{x^{a+b}y^{2}}{(1 − x^{a}y)(1 − x^{b}y)}.

In particular, setting y = 1 in the above expression yields that the generating function for the number of drops in all partitions of n with parts in \{1, k\} is given by \frac{x^{k+1}}{(1−x)(1−x^{k})}. Thus, the number of drops in the partitions of n with parts in {1, k} is ⌊(n − 1)/k⌋. This follows from the specific structure of the partitions with parts in {1, k}. A single drop occurs in all the partitions that do not consist of either all 1’s or all k’s. Thus, for n ∈ [n′k + 1, (n′ + 1)k), there are exactly n′ = ⌊(n − 1)/k⌋ drops.

7. Concluding Remarks

We have provided a very general framework for answering questions concerning the number of compositions, number of parts, and number of rises, levels and drops in all compositions of n with parts in A. We have used this framework to investigate compositions, palindromic compositions, Carlitz compositions, Carlitz palindromic compositions and partitions of n. Our results generalize work by several authors, and we have applied our results to the specific sets studied previously, which has led to several new results. In addition, our results can be applied to any set A ⊆ ℕ, which will allow for further study of special cases.

In addition, the techniques used in this paper can be used to investigate products of the number of rises, levels and drops which show interesting connections to the Fibonacci sequence. For example, by computing the derivative with respect to d twice in Theorem 2.1 (2) and setting y = r = ℓ = 1, we get that

∑_{n≥0} ∑_{σ∈C_{n}^{A}} drops(σ)(drops(σ) − 1)x^{n} = \frac{2x^{6}}{(1 − x − x^{2})^{3}} = 2x^{3} ∑_{n≥3} ( ∑_{a+b+c=n} F_{a}F_{b}F_{c}) x^{n},

i.e., a convolution of three Fibonacci sequences. However, the formulas for the various products become more complicated, and not as easy to evaluate.

References

[1] K. Alladi and V.E. Hoggatt, Compositions with ones and twos, Fibonacci Quarterly 13 (1975) No. 3, 233–239.

[2] L. Carlitz, Enumeration of compositions by rises, falls and levels, Mathematische Nachrichten 77 (1977) No.3, 254–264.

[3] L. Carlitz, Restricted Compositions, The Fibonacci Quarterly 14 (1976), 361–371.

[4] L. Carlitz, Enumeration of sequences by rises and falls: a refinement of the Simon Newcomb problem, Duke Math. J. 39 (1972), 267–280.

[5] P. Chinn, R. Grimaldi, and S. Heubach, Rises, levels, drops, and ”+” signs in compositions: extensions of a paper by Alladi and Hoggatt, The Fibonacci Quarterly 41 (2003) No. 3, 229–239.

[6] P. Chinn and S. Heubach, Compositions of n with no occurrence of k, Congressus Numerantium, 164 (2003), pp. 33–51.

[7] P. Chinn and S. Heubach, (1,k)-compositions, Congressus Numerantium, 164 (2003), pp. 183–194.

[8] I. P. Goulden and D. M. Jackson, Combinatorial enumeration, 1983, John Wiley & Sons, Inc.

[9] R. P. Grimaldi, Compositions without the summand 1, Congressus Numerantium 152 (2001), 33–43.

[10] R. P. Grimaldi, Compositions with Odd Summands, Congressus Numerantium 142 (2000), 113–127.

[11] V. E. Hoggatt, Jr. and M. Bicknell, Palindromic Compositions, Fibonacci Quarterly 13 (1975) No. 4, 350–356.

[12] S. Heubach and T. Mansour, Compositions of n with parts in a set, Congressus Numerantium, 168 (2004) 127–143.

[13] A. Knopfmacher and H. Prodinger, On Carlitz Compositions, European Journal of Combinatorics 19 (1998), No. 5, 579–589.

[14] D. Merlini, F. Uncini, and M.C. Verri, A unified approach to the study of general and palindromic compositions, INTEGERS: Electronic Journal of Combinatorial Number Theory 4 (2004), #A23.