\documentclass[12pt]{article} \textwidth= 6.5in \textheight= 9.0in \topmargin = -20pt \evensidemargin=0pt \oddsidemargin=0pt \headsep=25pt \parskip=10pt \font\smallit=cmti10 \font\smalltt=cmtt10 \font\smallrm=cmr9\usepackage{amssymb,latexsym}%\numberwithin{equation}{section}\newtheorem{theorem}{Theorem}[section]\newtheorem{proposition}[theorem]{Proposition}\newtheorem{corollary}[theorem]{Corollary}\newtheorem{definition}[theorem]{Definition}\newtheorem{conjecture}[theorem]{Conjecture}\newtheorem{remark}[theorem]{Remark}\newtheorem{lemma}[theorem]{Lemma}\newtheorem{fact}[theorem]{Fact}\newtheorem{example}[theorem]{Example}\newtheorem{axiom}[theorem]{Axiom}\newtheorem{property}[theorem]{Property}\newtheorem{problem}[theorem]{Problem}\newtheorem{notation}[theorem]{Notation}%\pagenumbering{arabic}\def\NN{\mathbb{N}}\def\rises{\mbox{rises}}\def\levels{\mbox{levels}}\def\drops{\mbox{drops}}\def\parts{\mbox{parts}}\def\sof{$\Box$}\def\ds{\displaystyle}\def\Aodd{A=\{m\,|\,m=2k+1, k \ge 0\}}% for formulas\def\mysum{\sum_{j=1}^\infty \frac{x^jy}{1-x^jy(\ell-d)}\prod_{i=1}^{j-1}\frac{1-x^iy(\ell-r)}{1-x^iy(\ell-d)}}\def\mynum{e(xy(l-d))-e(xy(l-r))}\def\myden{r \cdot e(xy(l-r))-d \cdot e(xy(l-d))}\begin{document}\vspace*{-60pt} \centerline{\smalltt INTEGERS:  \smallrm ELECTRONIC JOURNAL OF COMBINATORIAL NUMBER THEORY \smalltt 5 (2005), \#A11} \vskip 40pt \begin{center} \uppercase{\bf Counting rises, levels, and drops in compositions} \vskip 20pt {\bf Silvia Heubach}\\ {\smallit {Department of Mathematics, California State University LosAngeles, Los Angeles, CA 90032, USA}}\\ {\tt sheubac@calstatela.edu}\\  \vskip 10pt {\bf Toufik Mansour}\\ {\smallit Department of Mathematics, Haifa University,31905 Haifa, Israel}\\ {\tt toufik@math.haifa.ac.il}\\ \end{center} \vskip 30pt \centerline{\smallit Received: 2/5/05, Accepted: 6/21/05, Published:6/23/05} \vskip 30pt\centerline{\bf Abstract}A composition of $n\in\NN$ 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\subseteq\NN$ 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.\vskip 20pt\footnotesize\noindent {\bf AMS Classification Number}:  05A05, 05A15\noindent {\bf Key words}: Compositions, palindromic compositions,Carlitz compositions, partitions, generating functions.\normalsize\pagestyle{myheadings} \markright{\smalltt INTEGERS: \smallrm ELECTRONIC JOURNAL OF COMBINATORIAL NUMBER THEORY \smalltt 5 (2005), \#A11\hfill} \thispagestyle{empty}  \baselineskip=15pt  \vskip 30pt%===========================================================================\section*{\normalsize 1. Introduction} \addtocounter{section}{+1}A {\em composition} $\sigma=\sigma_1\sigma_2\ldots\sigma_m$ of$n\in\NN$ 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 {\em parts} of the composition. A {\empalindromic composition} of $n\in\NN$ is a composition for which$\sigma_1\sigma_2\ldots\sigma_m=\sigma_m\sigma_{m-1}\ldots\sigma_1$. A {\em Carlitz composition}is a composition of $n\in\NN$ 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 {\em rises}(a summand followed by a larger summand), {\em levels} (a summandfollowed by itself), and {\em 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~\cite{AH} 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~\cite{CH2}generalized to $A=\{1,k\}$ and derived all the respectivegenerating functions. Chinn, Grimaldi and Heubach~\cite{CGH}considered the case $A=\NN$, and derived generating functions forall quantities of interest. The focus of ~\cite{CGH} was on explicit formulas for the quantities of interest, as well as combinatorial proofs for the connections among them. Carlitz~\cite{Car1977} on the other hand approached the same topic from a generating function standpoint, and provided a connection to the Simon Newcomb problem~\cite{Car1972}. (Note: Carlitz counts an extra rise and drop at the beginning and the end of each composition). Grimaldi~\cite{G} studied$A=\{m|m=2k+1,k\ge 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~\cite{G2}, which wasgeneralized by Chinn and Heubach~\cite{CH} to $A=\NN-\{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~\cite{HB} 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~\cite{HM}, 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\subseteq A$. Most recently, Merlini et. al. ~\cite{Mer2004} 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=\NN$,$A=\{1,2\}$, $A=\{1,k\}$, $A=\NN-\{k\}$, and$A=\{m\,|\,m=2k+1,k\ge 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\}$.\section*{\normalsize 2. Main Result} \addtocounter{section}{+1}Let $\NN$ 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,\ldots,a_k\}$, where $a_1<a_2<a_3<\cdots<a_k$, withthe obvious modifications in the case $|A|=\infty$. In thetheorems and proofs, we will treat the two cases together ifpossible, and will note if the case $|A|=\infty$ 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,\ldots,a_k\}\subseteq\NN$, 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 $\sigma$, we denote the number ofparts, rises, levels, and drops by $\parts(\sigma)$,$\rises(\sigma)$, $\levels(\sigma)$, and $\drops(\sigma)$,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,\ell,d)=\sum_{n\geq0}\sum_{\sigma\inC_n^A}x^ny^{\parts(\sigma)}r^{\rises(\sigma)}\ell^{\levels(\sigma)}d^{\drops(\sigma)}$$and$$P_A(x;y;r,\ell,d)=\sum_{n\geq0}\sum_{\sigma\inP_n^A}x^ny^{\parts(\sigma)}r^{\rises(\sigma)}\ell^{\levels(\sigma)}d^{\drops(\sigma)}.$$The main result of this paper gives explicit expressions for these two generating functions.\begin{theorem}\label{mth}Let $A=\{a_1,\ldots,a_k\}$ be any ordered subset of $\NN$. Then\begin{enumerate}    \item The generating function for compositions is given by $$C_A(x;y;r,\ell,d)=\frac{1 +(1-d)\displaystyle{\sum}_{j=1}^k\left(\frac{\displaystylex^{a_j}y}{\displaystyle1-x^{a_j}y(\ell-d)}{\displaystyle\prod_{i=1}^{j-1}}\frac{\displaystyle 1-x^{a_i}y(\ell-r)}{\displaystyle1-x^{a_i}y(\ell-d)}\right)} {1-d\displaystyle\sum_{j=1}^k\left(\frac{\displaystyle x^{a_j}y}{\displaystyle1-x^{a_j}y(\ell-d)}\displaystyle \prod_{i=1}^{j-1}\frac{\displaystyle1-x^{a_i}y(\ell-r)}{\displaystyle 1-x^{a_i}y(\ell-d)}\right)}.$$    \item The generating function for palindromic compositions is given by $$P_A(x;y;r,\ell,d)=\frac{1+\displaystyle \sum_{i=1}^k\frac{\displaystyle x^{a_i}y+x^{2a_i}y^2(\ell-d \, r)}{\displaystyle 1-x^{2a_i}y^2(\ell^2-d \, r)}}{1-\displaystyle \sum_{i=1}^k\frac{\displaystyle x^{2a_i}y^2d \, r}{\displaystyle 1-x^{2a_i}y^2(\ell^2-d \, r)}}.$$   \end{enumerate}\end{theorem}Before giving the proof of Theorem~\ref{mth}, we will connect the generating function for compositions for $A=\NN$ with the result in~\cite{Car1977} to obtain the following expression, which is hard to prove directly.\begin{corollary}\label{eres}Let  $e(u)=e(u,x)=\sum_{n=0}^{\infty}\frac{u^n}{(x)_n} $ and $(x)_n=(1-x)(1-x^2)\cdots (1-x^n)$. Then $$\mysum = \frac{(1+d)\cdot e(xy(l-d))-(1+r)\cdot e(xy(l-r))}{ d^2 \cdot e(xy(l-d))+ (r-d(r+1) ) \cdot e(xy(l-r))}.$$\end{corollary}\noindent {\it 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 \cdot d$. Setting the two generating functions, namely Theorem~\ref{mth} Part (1) for $A=\NN$ and the right-hand side of Eq.  (4.6)~\cite{Car1977}, equal, we get that $$r \cdot d \cdot \frac{1 +(1-d)\mysum}{1-d\mysum} = r \cdot d \frac{\mynum}{\myden} .$$Solving for  $\mysum$, we obtain the desired result. \hfill $\Box$ We now turn to the proof of Theorem~\ref{mth}.\noindent {\it 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_1s_2\ldots s_e|x;y;r,\ell,d)=\sum_{n\geq0}\sum_{\sigma}x^ny^{\parts(\sigma)}r^{\rises(\sigma)}\ell^{\levels(\sigma)}d^{\drops(\sigma)}$$and$$P_A(s_1s_2\ldots s_e|x;y;r,\ell,d)=\sum_{n\geq0}\sum_{\sigma}x^ny^{\parts(\sigma)}r^{\rises(\sigma)}\ell^{\levels(\sigma)}d^{\drops(\sigma)},$$where the sum on the right side of the equation is over all thecomposition $\sigma\in C_n^A$ and $\sigma\in P_n^A$, respectively, such that the (palindromic) composition $\sigma$ starts with $s_1s_2\ldots s_e$, for $e \ge 1$. From the definitions of the generating functions, we immediately have the following:\begin{eqnarray}  C_A(x;y;r,\ell,d) &=& 1+\sum_{i=1}^k C_A(a_i|x;y;r,\ell,d) \label{eqaa}\\  P_A(x;y;r,\ell,d)&=& 1+\sum_{i=1}^k P_A(a_i|x;y;r,\ell,d), \label{eqba} \end{eqnarray}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,\ell,d)$ and $P_A(a_i|x;y;r,\ell,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,\ell,d)$ which together with  Equation~(\ref{eqaa}) 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_ia_j|x;y;r,\ell,d)=\left\{\begin{array}{ll}r\,x^{a_i}y \,C_A(a_j|x;y;r,\ell,d),& i<j\\\ell\, x^{a_i}y \,C_A(a_j|x;y;r,\ell,d),& i=j\\d \,x^{a_i} y \,C_A(a_j|x;y;r,\ell,d),& i>j\\\end{array}.\right.$$ Summing over $j$ and accounting for the single composition with exactly one part,namely $a_i$, gives\begin{eqnarray} \nonumber C_A(a_i|x;y;r,\ell,d) &=& x^{a_i}y + x^{a_i}y\, d\sum_{j=1}^{i-1}C_A(a_j|x;y;r,\ell,d)+ x^{a_i}y\, \ell\,C_A(a_i|x;y;r,\ell,d)\\   && \quad + \,x^{a_i}y\, r\sum_{j=i+1}^{k}C_A(a_j|x;y;r,\ell,d) \label{lemaa} \end{eqnarray}for $i=1,2,\ldots,k$. Let$t_{0}=C_A(x;y;r,\ell,d)$, $t_i=C_A(a_i|x;y;r,\ell,d)$ and$b_i=x^{a_i}y$, for $i=1,2,\ldots,k$. Then Equations~~(\ref{eqaa}) and~(\ref{lemaa}) result in this system of $k+1$equations in $k+1$ variables:{\small$$\left(\begin{array}{ccccccc}1&-1&-1&\cdots&-1&-1&-1\\0&1-b_1\ell&-b_1r&-b_1r&\cdots&-b_1r&-b_1r\\0&-b_2d&1-b_2\ell&-b_2r&\cdots&-b_2r&-b_2r\\0&-b_3d&-b_3d&1-b_3\ell&\cdots&-b_3r&-b_3r\\\vdots&&&\vdots&&&\vdots\\0&-b_{k-1}d&-b_{k-1}d&-b_{k-1}&\cdots&1-b_{k-1}\ell&-b_{k-1}r\\0&-b_{k}d&-b_{k}d&-b_{k}d&\cdots&-b_kd&1-b_{k}\ell\end{array}\right)\cdot\left(%\begin{array}{c}  t_0 \\  t_1\\  t_2 \\  t_4 \\  \vdots \\  t_{k-1} \\  t_{k} \\\end{array}%\right)=\left(%\begin{array}{c}  1 \\  b_1 \\  b_2 \\  b_3 \\  \vdots \\  b_{k-1} \\  b_k \\\end{array}%\right)$$}By Cramer's rule, $t_0 = \frac{\det(N_k)}{\det(M_k)}$, where $M_k$ is the $(k+1)\times(k+1)$ matrix of the system of equations and $N_k$ is the  $(k+1)\times(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.,{\small$$N_k=\left(\begin{array}{ccccccc}1&-1&-1&\cdots&-1&-1&-1\\b_1&1-b_1\ell&-b_1r&-b_1r&\cdots&-b_1r&-b_1r\\b_2&-b_2d&1-b_2\ell&-b_2r&\cdots&-b_2r&-b_2r\\b_3&-b_3d&-b_3d&1-b_3\ell&\cdots&-b_3r&-b_3r\\\vdots&&&\vdots&&&\vdots\\b_{k-1}&-b_{k-1}d&-b_{k-1}d&-b_{k-1}&\cdots&1-b_{k-1}\ell&-b_{k-1}r\\b_k&-b_{k}d&-b_{k}d&-b_{k}d&\cdots&-b_kd&1-b_{k}\ell\end{array}\right).$$}We nowderive formulas for $\det(N_k)$ and $\det(M_k)$. Expanding down thefirst column of $M_k$, we get that{\small$$\det(M_k)=\left|\begin{array}{llllll}1-b_1\ell&-b_1r&-b_1r&\cdots&-b_1r&-b_1r\\-b_2d&1-b_2\ell&-b_2r&\cdots&-b_2r&-b_2r\\-b_3d&-b_3d&1-b_3\ell&\cdots&-b_3r&-b_3r\\\vdots&&&\vdots&&\vdots\\-b_{k-1}d&-b_{k-1}d&-b_{k-1}&\cdots&1-b_{k-1}\ell&-b_{k-1}r\\-b_{k}d&-b_{k}d&-b_{k}d&\cdots&-b_kd&1-b_{k}\ell\end{array}\right|.$$}Subtracting the $(k-1)^{\mbox{\footnotesize st}}$ column from the$k^{\mbox{\footnotesize th}}$ column of the above matrix, thenexpanding down the resulting column gives\begin{equation}\label{detM}\det(M_k)=(1-b_k(\ell-d))\det(M_{k-1})-b_kd(1-b_{k-1}(\ell-r))\det(E(b_1,b_2,...,b_{k-2})),\end{equation}where$$E(b_1,b_2,...,b_{k-2})=\left(\begin{array}{ccccc}1-b_1\ell&-b_1r&-b_1r&\cdots&-b_1r\\-b_2d&1-b_2\ell&-b_2r&\cdots&-b_2r\\-b_3d&-b_3d&1-b_3\ell&\cdots&-b_3r\\\vdots&&\vdots&&\vdots\\-b_{k-2}d&-b_{k-2}d&-b_{k-2}d&\cdots&-b_{k-2}r\\1&1&1&\cdots&1\end{array}\right).$$Adding $(b_1r)$ 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(\ell-r))\det(E(b_2,...,b_{k-2})),$$and, since $\det(E(b_{k-2}))=(1-b_{k-2}(\ell-r))$,\begin{equation}\label{detE}\det(E(b_1,b_2,...,b_{k-2}))=\prod_{j=1}^{k-2}(1-b_j(\ell-r)).\end{equation}Equations~(\ref{detM}) and (\ref{detE}) result in$$\det(M_k)=(1-b_k(\ell-d))\det(M_{k-1})-b_kd\prod_{j=1}^{k-1}(1-b_j(\ell-r)).$$Thus, if we define $\det(M_0)=1$ and use the fact that$\det(M_1)=1-b_1\ell=1-b_1(\ell-d)-b_1d$, then we can show byinduction on $k$ that for all $k\geq1$,\begin{equation}\label{eqac}\det(M_k)=\prod_{j=1}^k(1-b_j(\ell-d))-d\sum_{j=1}^kb_j\prod_{i=1}^{j-1}(1-b_i(\ell-r))\prod_{i=j+1}^{k}(1-b_j(\ell-d)).\end{equation}Similarly, by subtracting $(b_kd)$ times the last row from the$k^{\mbox{\footnotesize th}}$ row in the matrix $N_k$ and thenexpanding across the resulting $k^{\mbox{\footnotesize th}}$ rowwe get$$\det(N_k)=(1-b_k(\ell-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(\ell-d))\det(N_{k-1})-b_k(1-d)\prod_{j=1}^{k-1}(1-b_j(\ell-r)).$$With $\det(N_0)=1$ and$\det(N_1)=1-b_1\ell+b_1=1-b_1(\ell-d)+(1-d)b_1$, we can show byinduction on $k$ that for all $k\geq1$,\begin{equation} \label{eqac2}\det(N_k)=\prod_{j=1}^k(1-b_j(\ell-d))+(1-d)\sum_{j=1}^kb_j\prod_{i=1}^{j-1}(1-b_i(\ell-r))\prod_{i=j+1}^{k}(1-b_j(\ell-d)).\end{equation} Substituting Equations~(\ref{eqac}) and (\ref{eqac2}) and$b_i=x^{a_i}y$ into $\frac{\det(N_k)}{\det(M_k)}$ completes theproof of Theorem~\ref{mth}(1). Note that if $|A|=\infty$, then theresult follows by taking limits as $k \rightarrow \infty$.We now prove part(2), which uses the same general idea of first deriving a recursion for $P_A(a_i|x;y;r,\ell,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_ia_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 \ne 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:\begin{eqnarray*}  P_A(a_i|x;y;r,\ell,d)&=& x^{a_i}y+x^{2a_i}y^2\ell+ x^{2a_i}y^2\ell^2 P_A(a_i|x;y;r,\ell,d)\\& & \quad + x^{2a_i}y^2d\,r\sum\nolimits_{j \ne i,j=1}^k P_A(a_j|x;y;r,\ell,d)\\   &=& x^{a_i}y+x^{2a_i}y^2\ell+ x^{2a_i}y^2(\ell^2-r\,d)P_A(a_i|x;y;r,\ell,d)\\   & & \quad + x^{2a_i}y^2d\,r(P_A(x;y;r,l,d)-1), \end{eqnarray*}where the last equality follows from Equation~(\ref{eqba}). We can now solve for $P_A(a_i|x;y;r,\ell,d)$, and substitute the result into Equation~(\ref{eqba}), which gives that $$P_A(x;y;r,\ell,d)=\frac{1+\sum\limits_{i=1}^k\frac{x^{a_i}y+x^{2a_i}y^2(\ell-dr)}{1-x^{2a_i}y^2(\ell^2-dr)}}{1-\sum\limits_{i=1}^k\frac{x^{2a_i}y^2dr}{1-x^{2a_i}y^2(\ell^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 \ne j$ when deriving $P_A(a_i|x;y;r,\ell,d)$. This allows us to solve for $P_A(a_i|x;y;r,\ell,d)$ in terms of $P_A(x;y;r,\ell,d)$, and allows for direct substituion. \hfill $\Box$We now apply Theorem~\ref{mth} to specific sets A to obtain previous and new results.%------------------------------------------------------------------\addtocounter{section}{+1}\setcounter{theorem}{0}\section*{\normalsize 3. Results for compositions with parts in$A$}\label{comps}  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~\ref{mth}(1)for $r=\ell=d=1$, we get that the generating functionfor the number of compositions of $n$ with $m$ parts in $A$ isgiven by\begin{equation} \label{comp-n-m}           \frac{1}{1-y\sum_{j=1}^kx^{a_j}}.\end{equation}Therefore, the generating function for the number of compositionsof $n$ with $m$ parts in $\NN$ is given by$$\sum_{n\geq0}\sum_{\sigma\inC_n^{\NN}}x^ny^{\parts(\sigma)}=\frac{1}{1-y\sum_{j=1}^{\infty}x^j}=\frac{1}{1-\frac{y\,x}{1-x}}=\sum_{m\geq0}\frac{x^m}{(1-x)^m}y^m.$$Furthermore, setting $y=1$ in Equation~(\ref{comp-n-m}) gives thegenerating function for the number of compositions of $n$ withparts in $A$ (see~\cite{HM}, Theorem 2.4):$$ \frac{1}{1-\sum_{j=1}^kx^{a_j}}.$$In particular, for $A=\NN$, the generating function for the numberof compositions of $n$ with parts in $\NN$ is given by (see \cite{CGH},Theorem 6)$$\frac{1-x}{1-2x}.$$Additional examples for specific choices of $A$ are given in~\cite{HM}. We now state results concerning the number of rises and drops.\subsection*{\normalsize 3.1 The number of rises and drops}\addtocounter{subsection}{+1}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 $\ell=d=1$ in Theorem~\ref{mth}(1) gives\begin{equation}\label{eqrr}C_A(x;y;r,1,1)=\frac{1}{1-\sum_{j=1}^k\left(x^{a_j}y\prod_{i=1}^{j-1}(1-x^{a_i}y(1-r))\right)}.\end{equation}Using Equation~(\ref{eqrr}) together with the fact that for $f_i(r) \ne 0$\begin{equation}\label{eqdiff}\frac{\partial}{\partial r}\prod_{i=1}^m f_i(r)=\left(\prod_{i=1}^m f_i(r)\right)\sum_{i=1}^m\frac{\frac{\partial}{\partial r}f_i(r)}{f_i(r)},\end{equation}we get that$$\label{eqnrr}\sum_{n\geq0}\sum_{\sigma\inC_n^A}\rises(\sigma)x^ny^{\parts(\sigma)}=\left.\frac{\partial}{\partial r}C_A(x;y;r,1,1)\right|_{r=1}=\frac{y^2\sum_{k\geq j>i\geq 1}x^{a_i+a_j}}{\left(1-y\sum_{j=1}^kx^{a_j}\right)^2}.$$Hence, expressing this function as a power series about $y=0$, weget the following result.\setcounter{theorem}{0}\begin{corollary}\label{co2}Let $A=\{a_1,\ldots,a_k\}$ be any ordered subset of $\NN$. Then$$\sum_{n\geq0}\sum_{\sigma\inC_n^A}\rises(\sigma)x^ny^{\parts(\sigma)}=\left(\sum_{k\geq j>i\geq 1}x^{a_i+a_j}\right)\sum_{m\geq0}(m+1)\left(\sum_{j=1}^kx^{a_j}\right)^my^{m+2}$$and$$\sum_{n\geq0}\sum_{\sigma\inC_n^A}\drops(\sigma)x^ny^{\parts(\sigma)}=\left(\sum_{k\geq j>i\geq 1}x^{a_i+a_j}\right)\sum_{m\geq0}(m+1)\left(\sum_{j=1}^kx^{a_j}\right)^my^{m+2}.$$\end{corollary}For example, letting $A=\NN$ and looking at the coefficient of$y^m$ in Corollary~\ref{co2} we get that the generating functionfor the number of rises (drops) in the compositions of $n$ with afixed number of parts, $m\geq2$,  in $\NN$ is given by\begin{eqnarray*}\lefteqn{\sum_{j>i\geq1}x^{i+j}(m-1)\left(\sum_{j\geq1}x^j\right)^{m-2}} \hspace{.5in}\\&=&\sum_{i\geq1}\sum_{j\geq i+1}x^{i+j}(m-1)\left(\frac{x}{1-x}\right)^{m-2}=\sum_{i\ge1}x^i\sum_{j\ge1}x^{2j}\frac{(m-1)x^{m-2}}{(1-x)^{m-2}}\\&=&\frac{x^3}{(1-x)(1-x^2)}\cdot \frac{(m-1)x^{m-2}}{(1-x)^{m-2}}=\frac{(m-1)x^{m+1}}{(1+x)(1-x)^{m}}.\end{eqnarray*}Furthermore, setting $y=1$ and $A=\NN$ in Corollary~\ref{co2}allows us to compute the generating function for the number of rises(drops) in all compositions of $n$ with parts in $\NN$ (see \cite{CGH}, Theorem6) in a similar way:\begin{eqnarray*}\sum_{n\geq0}\sum_{\sigma\inC_n^A}\rises(\sigma)x^n&=&\sum_{j>i\geq 1}x^{i+j}\sum_{m\geq0}(m+1)\left(\frac{x}{1-x}\right)^m=\frac{x^3}{(1-x)(1-x^2)}\cdot \frac{1}{(1-\frac{x}{1-x})^2}\\&=&\frac{x^3}{(1+x)(1-2x)^2}.\end{eqnarray*}For $A=\{1,k\}$ and $y=1$, Corollary~\ref{co2} gives thegenerating function for the number of rises (drops) in allcompositions of $n$ with parts in $\{1,k\}$ as (see~\cite{CH2},Theorem 4)$$\frac{x^{k+1}}{(1-x-x^k)^2}.$$For $\Aodd$ and $y=1$, and using that $\sum_{0 \le i<j}x^{(2i+1)+(2j+1)}=\sum_{i\ge 0}(x^2)^i \sum_{j \ge 1}(x^4)^j$,Corollary~\ref{co2} 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=\NN-\{k\}$ (studied in~\cite{CH}) and $A=\NN-\{1\}$ (studied in~\cite{G2}).For $A=\NN-\{k\}$, we define$g(x,y;k)=\sum_{n\geq0}\sum_{\sigma\inC_n^A}\rises(\sigma)x^ny^{\parts(\sigma)}$. Then Corollary~\ref{co2}gives{\small $$g(x,y;k)=\left(\frac{x^3}{(1-x)(1-x^2)}-\frac{x^{k+1}(1-x^{k-1})+x^{2k+1}}{1-x}\right)\sum_{m\geq0}(m+1)\left(\frac{x}{1-x}-x^k\right)^my^{m+2}.$$}For $k=1$, i.e., $A=\NN-\{1\}$ this expression reduces to$$g(x,y;1)=\sum_{m\geq2}(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\geq2$) isgiven by$$(m-1)\frac{x^{2m+1}}{(1+x)(1-x)^m}=\sum_{n\geq0}x^{n+2m-1}(m-1)\sum_{j=0}^n(-1)^{n-j}{{j+m-1} \choose {m-1}}.$$We now look at results concerning levels.\subsection*{\normalsize 3.2 The number of levels} \addtocounter{subsection}{+1}Proceeding similarly tothe case of rises, we set $r=d=1$ in Theorem~\ref{mth}(1) to get$$\label{eqll}C_A(x;y;1,\ell,1)=\frac{1}{1-\sum_{j=1}^k\frac{x^{a_j}y}{1-x^{a_j}y(\ell-1)}}.$$Therefore,$$\label{eqnll}\sum_{n\geq0}\sum_{\sigma\inC_n^A}\levels(\sigma)x^ny^{\parts(\sigma)}=\left.\frac{\partial}{\partial \ell}C_A(x;y;1,\ell,1)\right|_{\ell=1}=\frac{y^2\sum_{j=1}^kx^{2a_j}}{\left(1-y\sum_{j=1}^kx^{a_j}\right)^2}.$$Expressing the above function as a power series about $y=0$, we get thefollowing result.\begin{corollary}\label{co3}Let $A=\{a_1,\ldots,a_k\}$ be any ordered subset of $\NN$. Then$$\sum_{n\geq0}\sum_{\sigma\inC_n^A}\levels(\sigma)x^ny^{\parts(\sigma)}=\left(\sum_{j=1}^kx^{2a_j}\right)\sum_{m\geq0}(m+1)\left(\sum_{j=1}^kx^{a_j}\right)^my^{m+2}.$$\end{corollary}Using computations similar to those for rises and drops, bylooking at the coefficient of $y^m$, we get fromCorollary~\ref{co3} that the generating function for the number oflevels in all compositions of $n$ with a fixed number of parts $m$ in$\NN$ is given by            $$\frac{(m-1)x^{m}}{(1+x)(1-x)^{m-1}}.$$In addition, by setting $y=1$ and $A=\NN$ inCorollary~\ref{co3} we obtain that the generating function for thenumber of levels in the compositions of $n$ with parts in $\NN$ (see \cite{CGH}, Theorem 6) is givenby$$\frac{x^2(1-x)}{(1+x)(1-2x)^2}.$$Applying Corollary~\ref{co3} for $A=\{1,2\}$ and $y=1$, we get theresult given in Theorem 1.1~\cite{AH} 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~\cite{CH2}:$$\frac{x^2+x^{2k}}{(1-(x^k+x^{2k}))^2}.$$If we apply Corollary~\ref{co3} to $\Aodd$, 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=\NN-\{k\}$ and define$g(x,y;k)=\sum_{n\geq0}\sum_{\sigma\inC_n^A}\levels(\sigma)x^ny^{\parts(\sigma)}$. ThenCorollary~\ref{co3} gives$$g(x,y;k)=\left(\frac{x^2}{1-x^2}-x^{2k}\right)\sum_{m\geq0}(m+1)\left(\frac{x}{1-x}-x^k\right)^my^{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}.$$\addtocounter{section}{+1}\addtocounter{subsection}{-2}\setcounter{theorem}{0}\section*{\normalsize 4. Results for palindromic compositions with partsin$A$}\label{pals} Applying Theorem~\ref{mth}(2) for $r=\ell=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\sum_{i=1}^kx^{a_i}}{1-y^2\sum_{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 \cite{HM}, Theorem 3.2)$$\frac{1+\sum_{i=1}^kx^{a_i}}{1-\sum_{i=1}^k x^{2a_i}}.$$Using $A=\NN$ we get that the generatingfunction for the number of palindromic compositions of $n$ withparts in $\NN$ is given by (see \cite{CGH}, Theorem 6)$$\frac{1+x}{1-2x^2}.$$We now turn our attention to the number of rises and drops.\subsection*{{\normalsize 4.1 The number of rises and drops}}\addtocounter{subsection}{+1} As before,the number of rises equals the number of drops.Theorem~\ref{mth}(2) for $\ell=1$ and $d=1$ gives$$P_A(x;y;r,1,1)=\frac{1+\sum\limits_{i=1}^k\frac{x^{a_i}y+x^{2a_i}y^2(1-r)}{1-x^{2a_i}y^2(1-r)}}{1-\sum\limits_{i=1}^k\frac{x^{2a_i}y^2r}{1-x^{2a_i}y^2(1-r)}}.$$Therefore, by finding $\frac{\partial }{\partial r}P_A(x;y;r,1,1)$ and setting $r=1$ we obtain the followingresult.%---Corollary 3.3-----\begin{corollary}\label{cp1}Let $A=\{a_1,\ldots,a_k\}$ be any ordered subset of $\NN$. Thenthe generating function  $g_A(x;y)=\sum_{n\geq0}\sum_{\sigma\inP_n^A}\rises(\sigma)x^ny^{\parts(\sigma)}=\sum_{n\geq0}\sum_{\sigma\inP_n^A}\drops(\sigma)x^ny^{\parts(\sigma)}$ is given by$$\frac{y^2\left(1+y\sum_{i=1}^kx^{a_i}\right)\left(\sum_{i=1}^kx^{2a_i}(1-x^{2a_i}y^2)\right)-y^2\left(1-y^2\sum_{i=1}^kx^{2a_i}\right)\sum_{i=1}^kx^{2a_i}(1+x^{a_i}y)}{\left(1-y^2\sum_{i=1}^kx^{2a_i}\right)^2}.$$\end{corollary}For example, if $A=\NN$, then Corollary~\ref{cp1} gives that\begin{equation} \label{palN}g_{\NN}(x;y)=\frac{y^2\left(1+\frac{yx}{1-x}\right)\left(\frac{x^2}{1-x^2}-\frac{x^4y^2}{1-x^4})\right)-y^2\left(1-\frac{y^2x^2}{1-x^2}\right)\left(\frac{x^2}{1-x^2}+\frac{x^3y}{1-x^3}\right)}{\left(1-\frac{y^2x^2}{1-x^2}\right)^2}.\end{equation}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 $\NN$, by looking at the coefficient of $y^m$ in$g_{\NN}(x;y)$. To do so, we expand the numerator of$g_{\NN}(x;y)$ and collect terms according to powers of $y$:$$\frac{x^4y^3}{(1-x)^2(1+x)} \cdot \left(\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\right).$$ Furthermore,$$\frac{1}{\left(1-\frac{y^2x^2}{1-x^2}\right)^2}=\sum_{m \ge0}\frac{(m+1)x^{2m}}{(1-x^2)^m}y^{2m},$$ so altogether,\begin{eqnarray*}g_{\NN}(x;y)&=&\sum_{m\geq0}\frac{(m+1)x^{2m+4}}{(1-x)^2(1+x)(1-x^2)^m}y^{2m+3}\cdot \\&&\left(\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\right).\end{eqnarray*}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 $\NN$ isgiven by            $$\frac{(2m'-2)x^{2m'+2}}{(1+x^2)(1-x^2)^{m'}} \qquad \mbox{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'}} \qquad \mbox{for  } m=2m'-1.$$Furthermore, setting $y=1$ in Equation~(\ref{palN}) and simplifying yields that the generating function forthe number of rises (drops) in the compositions of $n$ with parts in $\NN$(see~\cite{CGH}, Theorem~6) is given by    $$g_{\NN}(x;1)=\frac{x^4(4x^4+4x^3+4x^2+3x+1)}{(1+x^2)(1+x+x^2)(1-2x^2)^2}.$$%---A={1,k}----We now apply Corollary~\ref{cp1} 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~\cite{CH2}, 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}.$$%---A=odd integersIf we let $\Aodd$ in Corollary~\ref{cp1}, then we get that thegenerating function $g_{A}(x;y)$ is given by$$\frac{y^2\left(1+\frac{x\,y}{1-x^2}\right)\left(\frac{x^2}{1-x^4}-\frac{y^2x^4}{1-x^8}\right)-y^2\left(1-\frac{x^2y^2}{1-x^4}\right)\left(\frac{x^2}{1-x^4}+\frac{x^3y}{1-x^6}\right)}{\left(1-\frac{x^2y^2}{1-x^4}\right)^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~\cite{G}.%---A=NN-kApplying Corollary~\ref{cp1} to $A=\NN-\{k\}$ gives that\begin{eqnarray*}g_{\NN-\{k\}}(x;y)&=&\frac{y^2\left(1+\frac{yx}{1-x}-yx^k\right)\left(\frac{x^2}{1-x^2}-x^{2k}-\frac{y^2x^4}{1-x^4}+y^2x^{4k}\right)}{\left(1-\frac{y^2x^2}{1-x^2}+y^2x^{2k}\right)^2}\\&&-\,\frac{y^2\left(1-\frac{y^2x^2}{1-x^2}+y^2x^{2k}\right)\left(\frac{x^2}{1-x^2}-x^{2k}+\frac{yx^3}{1-x^3}-yx^{3k}\right)}{\left(1-\frac{y^2x^2}{1-x^2}+y^2x^{2k}\right)^2}.\end{eqnarray*} 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=\NN-\{k\}$ is given by\begin{eqnarray*}g_{\NN-\{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}.\end{eqnarray*}This extends the work of Chinn and Heubach~\cite{CH}. Likewise, wecan extend the work of Grimaldi~\cite{G2} by setting $k=1$ to get that$$g_{\NN-\{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.\subsection*{\normalsize 4.2 The number of levels}\addtocounter{subsection}{+1} Theorem~\ref{mth}(2)for$r=d=1$ gives$$P_A(x;y;1,\ell,1)=\frac{1+\sum\limits_{i=1}^k\frac{x^{a_i}y+x^{2a_i}y^2(\ell-1)}{1-x^{2a_i}y^2(\ell^2-1)}}{1-\sum\limits_{i=1}^k\frac{x^{2a_i}y^2}{1-x^{2a_i}y^2(\ell^2-1)}}.$$Therefore, finding $\frac{\partial }{\partial \ell}P_A(x;y;1,\ell,1)$ and setting $\ell=1$ yields the followingresult.%-----Corollary 3.4 ----\begin{corollary}\label{cp2}Let $A=\{a_1,\ldots,a_k\}$ be any ordered subset of $\NN$.Then the generating function $g_A(x;y)=\sum_{n\geq0}\sum_{\sigma\inP_n^A}\levels(\sigma)x^ny^{\parts(\sigma)}$ is given by$$\frac{y^2\left(1-y^2\sum_{i=1}^kx^{2a_i}\right)\sum_{i=1}^kx^{2a_i}(1+2x^{a_i}y)+2y^4\left(1+y\sum_{i=1}^kx^{a_i}\right)\sum_{i=1}^kx^{4a_i}}{\left(1-y^2\sum_{i=1}^kx^{2a_i}\right)^2}.$$\end{corollary}For example, applying Corollary~\ref{cp2} for $A=\NN$ gives that the generatingfunction $g_{\NN}(x;y)$ for the number of levels in all palindromic compositions of$n$ with $m$ parts in $\NN$ is given by {\small\begin{equation} \label{levelsgf}\frac{x^2y^2\biggl(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)\biggr)}{(1+x^2)(1+x+x^2)(1-x^2-x^2y^2)^2}.\end{equation}} Since$$\frac{1}{(1-x^2-x^2y^2)^2}=\frac{1}{(1-x^2)^2(1-\frac{x^2y^2}{1-x^2})^2}=\frac{1}{(1-x^2)^2}\sum_{m\ge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~(\ref{levelsgf}):$$l_m(x)=\left\{\begin{array}{lll}\frac{x^2}{1-x^2}&\mbox{ for }& m=2\\\frac{(2m'-1-(2m'-3)x^2)x^{2m'}}{(1+x^2)(1-x^2)^{m'}}& \mbox{ for } & m=2m', \: m'\ge 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'}}& \mbox{ for } & m=2m'+1, \: m'\ge 1\end{array}.\right.$$In addition, setting $y=1$  in (\ref{levelsgf}) gives that thegenerating function for the number of levels in the palindromic compositionsof $n$ with parts in $\NN$ (see~\cite{CGH}, Theorem~6) is given by    $$g_{\NN}(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}.$$%---A={1,k}----If we let $A=\{1,k\}$ in Corollary~\ref{cp2}, then$g_{\{1,k\}}(x;y)$ is given by{\small $$\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^2x^2-y^2x^{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^2x^2-y^2x^{2k})^2}.$$This result was not explicitly stated in~\cite{CH2}, but can beeasily computed from the generating functions for other quantitiesgiven in~\cite{CH2}.%---A=odd integersWe look next at $\Aodd$. Applying Corollary~\ref{cp2} for thiscase, we get that$$g_{A}(x;y)=\frac{y^2\left(1-\frac{x^2y^2}{1-x^4}\right)\left(\frac{x^2}{1-x^4}+2\frac{x^3y}{1-x^6}\right)+2\frac{x^4y^4}{1-x^8}\left(1+\frac{x\,y}{1-x^2}\right)}{\left(1-\frac{x^2y^2}{1-x^4}\right)^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{\small $$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~\cite{G}.%---A=NN-kFinally, applying Corollary~\ref{cp2} for $A=\NN-\{k\}$ gives that the generating function$g_{\NN-\{k\}}(x;y)$ is given by{\small $$\frac{y^2\left(1-\frac{y^2x^2}{1-x^2}+y^2x^{2k}\right)\left(\frac{x^2}{1-x^2}-x^{2k}+\frac{2yx^3}{1-x^3}-2yx^{3k}\right)+2y^4\left(1+\frac{yx}{1-x}-yx^{k}\right)\left(\frac{x^4}{1-x^4}-x^{4k}\right)}{\left(1-\frac{y^2x^2}{1-x^2}+y^2x^{2k}\right)^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\begin{eqnarray*}\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}.\end{eqnarray*}This extends the work of Chinn and Heubach~\cite{CH}. Likewise, wecan extend the work of Grimaldi~\cite{G2} by setting $k=1$ to get that$$g_{\NN-\{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.\addtocounter{section}{+1}\addtocounter{subsection}{-2}\setcounter{theorem}{0}\section*{\normalsize 5. Results for Carlitz compositions with parts in$A$}\label{Carl} A {\em Carlitz composition\footnote{Originally called{\em waves} by L. Carlitz in~\cite{C}, and also known as {\em Smirnovsequences} (see~\cite{GouJac1983}, page 68). Named {\em Carlitzcompositions} by Knopfmacher and Prodinger in~\cite{KP} in honor of L.Carlitz}} of $n$, introduced in~\cite{C}, is a composition of $n$ inwhich no adjacent parts are the same. In other words, a Carlitzcomposition $\sigma$ is a composition with$\levels(\sigma)=0$. Carlitz~\cite{Car1977} specialized the general results for compositions with parts in $A=\NN$ to Carlitz compositions, but did not consider {\em Carlitz palindromic compositions}. Knopfmacher and Prodinger\cite{KP} stated results for the total number of Carlitz compositions without reference to the function $e(u,x)$ defined in Corollary~\ref{eres}.  In this section, we will apply Theorem~\ref{mth} 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 \cap P_n^A$.\subsection*{\normalsize 5.1 The number of Carlitz compositions}\addtocounter{subsection}{+1}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)=\sum_{n\geq0}\sum_{\sigma\in E_n^A}x^ny^{\parts(\sigma)}r^{\rises(\sigma)}d^{\drops(\sigma)}.$$Since $E_A(x;y;r,d)=C_A(x;y;r,0,d)$, Theorem~\ref{mth}(1) for $\ell=0$ gives the followingresult.\begin{corollary}\label{car1}Let $A=\{a_1,\ldots,a_k\}$ be any ordered subset of $\NN$. Then$$E_A(x;y;r,d)=1+\frac{\ds \sum_{j=1}^k\left(\frac{x^{a_j}y}{1+x^{a_j}y\,d}\ds \prod_{i=1}^{j-1}\frac{1+x^{a_i}y\,r}{1+x^{a_i}y\,d}\right)}{1-\ds \sum_{j=1}^k\left(\frac{x^{a_j}y\,d}{1+x^{a_j}y\,d} \ds \prod_{i=1}^{j-1}\frac{1+x^{a_i}y\,r}{1+x^{a_i}y\,d}\right)}.$$\end{corollary}Note that equating $E_A(x;y;r,d)$ with the result of Theorem 3~\cite{Car1977} gives  Corollary~\ref{eres} for $\ell=0$. We now look at specific sets $A$. Setting $r=d=1$ in Corollary~\ref{car1} we obtainthe generating function for the number of Carlitz compositions with$m$ parts in $A$ (for the case $A=\NN$, see~\cite{KP}) as$$E_A(x;y;1,1)=\frac{1}{1-\sum_{j=1}^k\frac{x^{a_j}y}{1+x^{a_j}y}}.$$Applying Corollary~\ref{car1} 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^ay)(1+x^by)}{1-x^{a+b}y^2}=1+(x^a+x^b)y+\sum_{m\ge 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}}.$$\noindent{\bf 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:\begin{eqnarray} \label{CC} n \qquad \quad &\mbox{Carlitz compositions of }n\nonumber \\n'(a+b)\quad &abab \ldots ab, \,baba \dots ba \nonumber \\n'(a+b)+a & abab \ldots aba\\ \nonumbern'(a+b)+b & babab \ldots ab\end{eqnarray}Thus, the number of Carlitz compositions of $n>0$ is 2 if$n\equiv 0 \,(\mbox{mod}(a+b))$, 1 if $n\equiv a \,(\mbox{mod}(a+b))$ or $\equiv b \,(\mbox{mod}(a+b))$, and 0 otherwise.Next we look at the number of rises and drops in Carlitz compositions.\subsection*{\normalsize 5.2 The number of rises and drops}\addtocounter{subsection}{+1}As before, the number of rises equals the number of drops. Using Corollary~\ref{car1} to find anexplicit expression for $\left.\frac{\partial }{\partial r}E_A(x;y;r,1)\right|_{r=1}$ givesthe following result.\begin{corollary}\label{car2}Let $A=\{a_1,\ldots,a_k\}$ be any ordered subset of $\NN$. Thenthe generating functions $\sum_{n\geq0}\sum_{\sigma\inE_n^A}\rises(\sigma)x^ny^{\parts(\sigma)}$ and $\sum_{n\geq0}\sum_{\sigma\inE_n^A}\drops(\sigma)x^ny^{\parts(\sigma)}$ are given by$${\ds \sum_{j=1}^k\left(\frac{x^{a_j}y}{1+x^{a_j}y}\ds \sum_{i=1}^{j-1}\frac{x^{a_i}y}{1+x^{a_i}y}\right)}\left/{\left(1-\ds \sum_{j=1}^k\frac{x^{a_j}y}{1+x^{a_j}y}\right)^2}\right..$$\end{corollary}Setting $A=\NN$ and $y=1$ in Corollary~\ref{car2} yields that the generating function for the number of rises (drops) in the Carlitz compositions of $n$ with parts in $\NN$ is givenby$$\frac{\sum_{j\geq1}\left(\frac{x^j}{1+x^j}\sum_{i=1}^{j-1}\frac{x^i}{1+x^i}\right)}{\left(1-\sum_{j\ge1}\frac{x^j}{1+x^j}\right)^2}.$$Applying Corollary~\ref{car2} for $A=\{a,b\}$ gives that\begin{eqnarray*}\sum_{n\geq0}\sum_{\sigma\inE_n^A}\rises(\sigma)x^ny^{\parts(\sigma)}&=&\frac{x^{a+b}y^2(1+x^ay)(1+x^by)}{(1-x^{a+b}y^2)^2}\\&=&\sum_{m\geq1}x^{m(a+b)}\left((2m-1)y^{2m}+m(x^a+x^b)y^{2m+1}\right),\end{eqnarray*}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\ge (a+b)$ with parts in $\{a,b\}$ is given by$$ \left\{\begin{array}{ll}            2n'-1 & \mbox{  if  }\: n=(a+b)n' \quad\mbox{for } n' \ge 1 \\           n' & \mbox{  if  }\: n=(a+b)n'+a \mbox{  or  } n=(a+b)n'+b \\         \end{array}\right. .$$This follows immediately from (\ref{CC}) 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.%------Carlitz palindromic compositions ----We now derive results for Carlitz palindromic compositions.\subsection*{\normalsize 5.3 The number of Carlitz palindromiccompositions} \addtocounter{subsection}{+1}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)=\sum_{n\geq0}\sum_{\sigma\in F_n^A}x^ny^{\parts(\sigma)}r^{\rises(\sigma)}.$$Note that $F_A(x;y;r)=P_A(x;y;r,0,1)$. Using Theorem~\ref{mth}(2) for $\ell=0$ and $d=1$ gives the following result.\begin{corollary}\label{carp1}Let $A=\{a_1,\ldots,a_k\}$ be any ordered subset of $\NN$. Then$$F_A(x;y;r)=1+\frac{\sum\limits_{i=1}^k\frac{x^{a_i}y}{1+x^{2a_i}y^2r}}{1-\sum\limits_{i=1}^k\frac{x^{2a_i}y^2r}{1+x^{2a_i}y^2r}}.$$\end{corollary}Applying Corollary~\ref{carp1} 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'\ge 0$, and 0 otherwise. This follows immediately from (\ref{CC}), since the Carlitz compositions for $n=(a+b)n'$ are not symmetric.\subsection*{\normalsize 5.4 The number of rises and drops}\addtocounter{subsection}{+1}We now study the number of rises (drops) inall Carlitz palindromic compositions of $n$ with $m$ parts in $A$. Using Corollary~\ref{carp1} to compute $\left.\frac{\partial }{\partial r} F_A(x;y;r)\right|_{r=1}$ gives the following result.\begin{corollary}\label{carp2}Let $A=\{a_1,\ldots,a_k\}$ be any ordered subset of $\NN$.Then the generating function for the number of rises inall Carlitz palindromic compositions of $n$ with $m$ parts in $A$is given by$$\left.\frac{\partial }{\partial r} F_A(x;y;r)\right|_{r=1}=\frac{\sum_{i=1}^k\frac{x^{3a_i}y^3}{(1+x^{2a_i}y^2)^2}\left(\sum_{i=1}^k\frac{x^{2a_i}y^2}{1+x^{2a_i}y^2}-1\right)+\sum_{i=1}^k\frac{x^{a_i}y}{1+x^{2a_i}y^2}\sum_{i=1}^k\frac{x^{2a_i}y^2}{(1+x^{2a_i}y^2)^2}}{\left(1-\sum\limits_{i=1}^k\frac{x^{2a_i}y^2}{1+x^{2a_i}y^2}\right)^2}.$$\end{corollary}Applying Corollary~\ref{carp2} for $A=\{a,b\}$ gives that$$\sum_{n\geq0}\sum_{\sigma\inF_n^A}\rises(\sigma)x^ny^{\parts(\sigma)}=\frac{x^{a+b}y^3(x^a+x^b)}{(1-x^{a+b}y^2)^2}=(x^a+x^b)\sum_{m\geq1}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 \ge a+b$ with parts in $\{a,b\}$ is given by$$ n' \: \mbox{  if  }\: n=(a+b)n'+a \mbox{  or  } n=(a+b)n'+b \: \mbox{  for  }\: n'\ge 1\quad \mbox{and}\quad  0 \:\mbox{  otherwise} .$$This follows immediately from (\ref{CC}), as the Carlitz compositions for $n=(a+b)n'+a$ and $n=(a+b)n'+b$ are symmetric.%---- partitions ----Last, but not least, we apply Theorem~\ref{mth} to obtain results for partitions.\addtocounter{section}{+1}\addtocounter{subsection}{-4}\setcounter{theorem}{0}\section*{\normalsize 6. Partitions with parts in $A$}\label{parts}A {\em partition} $\sigma$ of $n$ is a composition of $n$ with$\rises(\sigma)=0$. Let $G_n^A$ be the set of all partitions of $n$with parts in $A$.\subsection*{\normalsize 6.1 The number of partitions}\addtocounter{subsection}{+1}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;\ell,d)=\sum_{n\geq0}\sum_{\sigma\inG_n^A}x^ny^{\parts(\sigma)}\ell^{\levels{\sigma}}d^{\drops(\sigma)}.$$Note that $G_A(x;y;\ell,d)=C_A(x;y;0,l,d)$. Using Theorem~\ref{mth}(1) for $r=0$ we get thefollowing result.\begin{corollary}\label{par1}Let $A=\{a_1,\ldots,a_k\}$ be any ordered subset of $\NN$. Thenthe generating function $G_A(x;y;\ell,d)$ is given by$$1+\frac{\sum_{j=1}^k\left(\frac{x^{a_j}y}{1-x^{a_j}y(\ell-d)}\prod_{i=1}^{j-1}\frac{1-x^{a_i}y\ell}{1-x^{a_i}y(\ell-d)}\right)}{1-d\sum_{j=1}^k\left(\frac{x^{a_j}y}{1-x^{a_j}y(\ell-d)}\prod_{i=1}^{j-1}\frac{1-x^{a_i}y\ell}{1-x^{a_i}y(\ell-d)}\right)}.$$\end{corollary}For example, if we apply Corollary~\ref{par1} for $A=\NN$ and $\ell=d=1$ and use the identity\begin{equation}\label{eqd1}\sum_{j=1}^k x^{a_j}\prod_{i=1}^{j-1}(1-x^{a_i}\alpha)=\frac{1}{\alpha}\left(1-\prod_{j=1}^k (1-x^{a_j}\alpha)\right),\end{equation}then we get that the generating function for the number of partitions of$n$ with $m$ parts in $A=\NN$ is given by$$F_\NN(x;y;1,1)=\prod_{j\geq1}(1-x^jy)^{-1}.$$Note that the identity in (\ref{eqd1}) follows from the fact that$$1-\alpha \sum_{j=1}^k x^{a_j}\prod_{i=1}^{j-1}(1-x^{a_i}\alpha)=\left(1-\prod_{j=1}^k (1-x^{a_j}\alpha)\right),$$which can be easily proved by induction.Another interesting example, namely setting $\ell=0$ and $d=1$ inCorollary~\ref{par1}, 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-\sum_{j=1}^kx^{a_j}y\prod_{i=1}^j(1+x^{a_i}y)^{-1}}=\prod_{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 $\NN$ with distinct partsis given by $\prod_{j\geq1}(1+x^j)$.\subsection*{\normalsize 6.2 The number of levels and drops}\addtocounter{subsection}{+1}We now study the number of levels and drops in all partitions of $n$. Using Corollary~\ref{par1} to compute$\left.\frac{\partial}{\partial\ell}G_A(x;y;\ell,1)\right|_{\ell=1}$ and$\left.\frac{\partial}{\partial d}G_A(x;y;1,d)\right|_{d=1}$, we get the followingresult.\begin{corollary}\label{partld}Let $A=\{a_1,\ldots,a_k\}$ be any ordered subset of $\NN$. Thenthe generating function $\sum_{n\geq0}\sum_{\sigma\inG_n^A}\levels(\sigma)x^ny^{\parts(\sigma)}$ is given by$$\frac{\sum_{j=1}^k\left(x^{2a_j}y^2\prod_{i=1}^{j-1}(1-x^{a_i}y)\right)-\sum_{j=1}^k\left(x^{a_j}y\prod_{i=1}^{j-1}(1-x^{a_i}y)\sum_{i=1}^{j-1}\frac{x^{2a_i}y^2}{1-x^{a_i}y}\right)}{\prod_{j=1}^k(1-x^{a_j}y)^2},$$ and the generating function$\sum_{n\geq0}\sum_{\sigma\inG_n^A}\drops(\sigma)x^ny^{\parts(\sigma)}$ is given by$$\frac{\left(1-\prod_{j=1}^k(1-x^{a_j}y)\right)^2-y^2\sum_{j=1}^k\left(x^{a_j}\prod_{i=1}^{j-1}(1-x^{a_i}y)\sum_{i=1}^{j}x^{a_i}\right)}{\prod_{j=1}^k(1-x^{a_j}y)^2}.$$\end{corollary}\noindent {\it Proof.}We give a sketch of the proof for the first generating function. Since $G_A(x;y;l,1)=1+\frac{S(\ell)}{1-S(\ell)}$, where$$S(\ell)=\sum_{j=1}^k\left(\frac{x^{a_j}y}{1-x^{a_j}y(\ell-1)}\prod_{i=1}^{j-1}\frac{1-x^{a_i}y\ell}{1-x^{a_i}y(\ell-1)}\right)=\sum_{j=1}^k\left(g_j(\ell)\prod_{i=1}^{j-1}f_i(\ell)\right),$$we get that $$\frac{\partial}{\partial\ell}G_A(x;y;\ell,1)=\frac{\frac{\partial}{\partial\ell}S(\ell)}{(1-S(\ell))^2}=\frac{\sum_{j=1}^k\frac{\partial}{\partial\ell}g_j(\ell)\prod_{i=1}^{j-1}f_i(\ell)+g_j(\ell)\frac{\partial}{\partial\ell}\prod_{i=1}^{j-1}f_i(\ell)}{(1-S(\ell))^2}.$$Using Equation~(\ref{eqdiff}) gives that $\frac{\partial}{\partial\ell}\prod_{i=1}^{j-1}f_i(\ell)=-\prod_{i=1}^k f_i(\ell)\sum_{j=1}^k\frac{x^{2a_j}y^2}{(1-x^{a_j}y\ell)(1-x^{a_j}y(\ell-1))}$. Computing $\frac{\partial}{\partial\ell}g_j(\ell)$, setting $\ell = 1$ in the expression for $\frac{\partial}{\partial\ell}G_A(x;y;\ell,1)$, then using Equation~(\ref{eqd1}) to simplify the denominator gives the stated result.\hfill $\Box$Applying Corollary~\ref{partld} 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^by)+x^{2b}y^2(1-x^ay)}{(1-x^ay)^2(1-x^by)^2} \qquad \mbox{and} \qquad \frac{x^{a+b}y^2}{(1-x^ay)(1-x^by)}.$$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 $\lfloor (n-1)/k \rfloor$. 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 \in [n'k+1,(n'+1)k)$, there are exactly $n'=\lfloor (n-1)/k \rfloor$ drops.\section*{\normalsize 7. Concluding Remarks}\addtocounter{section}{+1}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 \subseteq \NN$,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~\ref{mth}(2) and setting $y=r=\ell=1$, we get that$$\sum_{n\geq0}\sum_{\sigma\in C_n^A}\drops(\sigma)(\drops(\sigma)-1)x^n=\frac{2x^6}{(1-x-x^2)^3}=2x^3\sum_{n\geq3}\left(\sum_{a+b+c=n}F_aF_bF_c\right)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.%==================================================================\footnotesize \begin{thebibliography}{99}\bibitem{AH}{\sc K. Alladi and V.E. Hoggatt}, Compositions with ones and twos,{\em Fibonacci Quarterly} {\bf 13} (1975) No. 3, 233--239.\bibitem{Car1977}{\sc L. Carlitz}, Enumeration of compositions by rises, falls and levels, {\em Mathematische Nachrichten} {\bf 77} (1977) No.3, 254--264.\bibitem{C}{\sc L. Carlitz}, Restricted Compositions, {\em The FibonacciQuarterly} {\bf 14} (1976), 361--371.\bibitem{Car1972}{\sc L. Carlitz}, Enumeration of sequences by rises and falls: a refinement of              the {S}imon {N}ewcomb problem, {\em Duke Math. J.} {\bf 39} (1972), 267--280.\bibitem{CGH}{\sc P. Chinn, R. Grimaldi, and S. Heubach}, Rises, levels,drops, and "+" signs in compositions: extensions of a paper byAlladi and Hoggatt, {\em The Fibonacci Quarterly} {\bf 41} (2003)No. 3, 229--239.\bibitem{CH}{\sc P. Chinn and S. Heubach}, Compositions of $n$ with nooccurrence of $k$, {\emCongressus Numerantium}, {\bf 164} (2003), pp. 33--51.\bibitem{CH2}{\sc P. Chinn and S. Heubach}, (1,$k$)-compositions, {\emCongressus Numerantium}, {\bf 164} (2003), pp. 183--194.\bibitem{GouJac1983}{\sc I. P. Goulden and D. M. Jackson}, {\emCombinatorial enumeration}, 1983, John Wiley \& Sons, Inc. \bibitem{G2}{\sc R. P. Grimaldi}, Compositions without the summand 1, {\emCongressus Numerantium} {\bf 152} (2001), 33--43.\bibitem{G}{\sc R. P. Grimaldi}, Compositions with Odd Summands, {\emCongressus Numerantium} {\bf 142} (2000), 113--127.\bibitem{HB}{\sc V.~E.~Hoggatt, Jr. and M. Bicknell},  PalindromicCompositions, {\em Fibonacci Quarterly} {\bf 13} (1975) No. 4,350--356.\bibitem{HM}{\sc S. Heubach and T. Mansour}, Compositions of $n$ with parts ina set, {\emCongressus Numerantium}, {\bf 168} (2004) 127--143.\bibitem{KP}{\sc A. Knopfmacher and H. Prodinger}, On Carlitz Compositions,{\em European Journal of Combinatorics} {\bf 19} (1998), No. 5,579--589.\bibitem{Mer2004}{\sc D. Merlini, F. Uncini, and M.C. Verri}, A unified approach to the study of general and palindromic compositions, {\em INTEGERS: Electronic Journal of Combinatorial Number Theory} {\bf 4} (2004), \#A23. \end{thebibliography}\end{document}