Compositions 73
after appropriate re-indexing. Thus, the number of compositions of 2n with
j parts in {2, 4, 6,...} is given by C
{2,4,6,...}
(j;2n)=
n−1
j−1
, which is also the
number of compositions of 2n − j with j odd parts.
Turning our attention to the total number of compositions with odd parts,
Theorem 3.13 gives
C
{1,3,5,...}
(x)=
1
1 −
x
1 − x
2
=
1 − x
2
1 − x − x
2
.
This is the generating function of the modified Fibonacci sequence (
ˆ
F
0
=1,
ˆ
F
n
= F
n
for n ≥ 1), therefore, the number of compositions of n with parts in
{1, 3, 5,...} is given by F
n
for n ≥ 1, which was proved in Theorem 3.12 using
the recurrence relation. More generally, let N
d,e
be the set of all numbers of
the form k · d + e where k ≥ 0, d, e ∈ N. Then Theorem 3.13 yields
C
N
d,e
(x)=
1
1 −
x
e
1 − x
d
=
1 − x
d
1 − x
e
− x
d
.
If d =2e, then the set A consists of all odd multiples of e,and
C
N
2e,e
(x)=C
{e,3e,5e,...}
(x)=
1 − x
2e
1 − x
e
− x
2e
= g
ˆ
F
(x
e
).
Thus, the number of compositions of n = k · e with parts in {e, 3e, 5e,...}
is given by F
k
for k ≥ 1. This result can be readily explained using a com-
binatorial argument: multiply each part of a composition of n with parts in
{1, 3, 5,...} by e to create a composition of n · e with parts in {e, 3e, 5e,...}.
In the examples discussed so far, the generating function we obtain when
applying Theorem 3.13 to a specific set A can be expanded into a series that
allows us to obtain an explicit expression for C
A
(n). This is not always the
case, as will be seen in the next example.
Example 3.17 Let A = {2, 3, 5, 7, 11, 13,...} be the set of prime numbers.
Then
C
A
(x)=
1
1 −
p∈A
x
p
.
Since powers of x
n
for n ≤ K cannot involve powers of x
p
with p>Kfor some
constant K, we can use the function 1/(1 −
p∈A,p≤K
x
p
) to approximate
C
A
(x) for powers up to K. Using Maple or Mathematica, we expand the
approximate function into its Taylor series. Since the 11th prime number is
31,wecanusethefinitesumwith11 terms to get correct values for C
A
(n)
for n ≤ 31.HereistheMathematica code for series expansion:
Series[1/(1 - Sum[x^Prime[n], {n, 1, 11}]), {x, 0, 30}]
© 2010 by Taylor and Francis Group, LLC