Maximum Part-Products of Odd Palindromic Compositions

Andrew Kenney and Caroline Shapcott Department of Mathematical Sciences Indiana University South Bend 1700 Mishawaka Avenue South Bend, IN 46634-7111 USA

                       ankenney@iusb.edu
                       shapcott@iusb.edu

Abstract We derive explicit formulas for the maximum part-product over the set of palindromic compositions of a given integer and over the set of palindromic compositions of a given integer with only odd parts. These results are extensions of the well-known elementary formula for the maximum part-product over the set of classical partitions.

1 Introduction

An integer composition of n, or simply a composition of n, is a sequence of positive integers that sum to n. A question that frequently arises as a challenge problem (for instance, during math competitions and Putnam exams) is to find the maximum product of such a sequence for a given integer n. The following well-known result is noted by Beevers [2] and derived by the second author [6], and the continuous analogue of the problem is studied by Goodman [4]. The sequence itself is found in Sloane’s Online Encyclopedia of Integer Sequences as sequence number \underline{A000792} [1]. We record the result as a lemma for easy reference.

Lemma 1. The maximum part-product over all compositions of n, for n ≥ 2, is

M_{n} = \begin{cases}3^{\frac{n}{3}} , & if n ≡ 0 (mod 3); \\ 4 · 3^{\frac{n−4}{3}} , & if n ≡ 1 (mod 3); \\ 2 · 3^{\frac{n−2}{3}} , & if n ≡ 2 (mod 3). \end{cases}

Note that M_{0} = M_{1} = 1.

A more interesting question to consider is how the part-product is affected when restrictions are placed on the part-sizes. Došlić extends the result to the case when the composition (equivalently, partition) is required to have either distinct parts or only odd parts [3]. In this paper, we consider two cases. First, we consider compositions (no longer partitions) that are palindromic, meaning the part-sequence must be the same whether read from left-to-right or right-to-left. Second, we consider the case when a palindromic composition contains only odd parts. The proofs are elementary and are completed through a detailed analysis of cases.

Throughout the paper, we will repeatedly use j to denote an arbitrary nonnegative integer, especially when referring to modular equivalence.

2 Palindromic compositions

A palindromic composition of n is a sequence of positive integers or parts that sum to n and whose part-sequence is the same whether it is read from left-to-right or right-to-left. For example, (1, 1, 2, 1, 1) is a palindromic composition of n = 6. See Heubach and Mansour’s comprehensive text for an overview of the literature on palindromic compositions [5].

Throughout the proofs of Theorems 2 and 3, we will use the term subword of a composition to mean a list of parts of the composition that are in the order in which they appear in the composition but are not necessarily consecutive within the composition.

Theorem 2. The maximum part-product over all palindromic compositions of n is

P_{n} = \begin{cases}5, & if n = 5; \\ 16 · 3^{\frac{n−8}{3}} , & if n ≡ 5 (mod 6) and n > 5; \\ M_{n}, & if n ≢ 5 (mod 6). \end{cases}

Note that M_{n} is the maximum product defined in Lemma 1.

Proof. Let X_{n} be the set of all compositions of n and let Y_{n} be the set of all palindromic compositions of n. Note that Y_{n} ⊆ X_{n}; therefore, if there is a composition in Y_{n} whose product equals M_{n}, then P_{n} = M_{n}.

At this point, we must understand something about the structure of a composition attaining M_{n}. For all n ≥ 2, the product M_{n} is attained by a composition of only 2s and 3s. Specifically, the composition contains either zero, one, or two parts of size 2 (depending on the equivalence class of n), and the remaining parts of the composition are all parts of size 3.

Let a be the number of 2s and b be the number of 3s needed to attain M_{n}. If a and b are both even, or if only one of a and b is odd, then there does exist a palindromic composition in Y_{n} that attains M_{n} (for example, (2, 3, 2), (3, 2, 3), or (2, 3, 3, 2)). However, when a and b are both odd, no such composition exists in Y_{n}. In this situation, a = 1 and b = \frac{n−2}{3} = 2j +1, for some nonnegative integer j, and therefore n = 6j + 5.

Specifically, we have the following six cases:

• If n ≡ 0 (mod 6), i.e., n = 6j, then n ≡ 0 (mod 3) and we can attain M_{n} by letting a = 0 and b = \frac{6j}{3} = 2j. In this case, we have the palindromic composition consisting of an even number of 3s.

• If n ≡ 1 (mod 6), i.e., n = 6j + 1, then n ≡ 1 (mod 3) and we can attain M_{n} by letting a = 2 and b = \frac{6j+1−4}{3} = 2j − 1. In this case, we have the palindromic composition consisting of an odd number of 3s in the center flanked by one 2 on either side.

• If n ≡ 2 (mod 6), i.e., n = 6j + 2, then n ≡ 2 (mod 3) and we can attain M_{n} by letting a = 1 and b = \frac{6j+2−2}{3} = 2j. In this case, we have the palindromic composition consisting of one 2 in the center flanked by an equal number of 3s on either side.

• If n ≡ 3 (mod 6), i.e., n = 6j + 3, then n ≡ 0 (mod 3) and we can attain M_{n} by letting a = 0 and b = \frac{6j+3}{3} = 2j + 1. In this case, we have the palindromic composition consisting of an odd number of 3s.

• If n ≡ 4 (mod 6), i.e., n = 6j + 4, then n ≡ 1 (mod 3) and we can attain M_{n} by letting a = 2 and b = \frac{6j+4−4}{3} = 2j. In this case, we have the palindromic composition consisting of an even number of 3s in the center flanked by one 2 on either side.

• Finally, let n ≡ 5 (mod 6), i.e., n = 6j + 5. Suppose, to the contrary, that there exists a palindromic composition that attains M_{n}. Since n ≡ 2 (mod 3), we have a = 1. However, then b = \frac{6j+5−2}{3} = 2j + 1 and we are unable to form a palindromic composition with both an odd number of 3s and an odd number of 2s.

By inspection, we see that P_{5} = 5. Therefore, we need only consider the case when n ≡ 5 (mod 6) and n > 5. Note that in this case n is odd and therefore the composition must have a center part; moreover, the center part itself must be odd.

Let λ be the center part of a palindromic composition attaining the maximum partproduct P_{n}. If λ ≥ 7 and λ ≡ 1 (mod 4), i.e., λ = 4j + 1, then λ can be replaced with one 1 and 2j 2s, in order to obtain a palindromic composition with a greater product. If λ ≥ 7 and λ ≡ 3 (mod 4), i.e., λ = 4j + 3, then λ can be replaced with one 3 and 2j 2s, in order to obtain a palindromic composition with a greater product. Thus, there is no need for a center part of any size other than 1, 3, or 5.

Next consider the side parts. Suppose there are k parts of size 1 on either side of the center part λ. If k is even, replace the 1s on each side with \frac{k}{2} 2s. If k is odd, replace the 1s on each side with \frac{k−1}{2} 2s and one 1. In this way we obtain a palindromic composition with a greater product, so there is no need for more than one 1 on either side of the center part.

If there is a part of size 4 on either side of the center part λ, replace the subword (4, 4) with (2, 2, 2, 2) to obtain a palindromic composition with the same product. If there is a part of size 5 on either side of the center part λ, replace the subword (5, 5) with (2, 3, 3, 2) to obtain a palindromic composition with a greater product. If there is a part of size m ≥ 6 on either side of the center part, replace each m with \frac{m}{2} 2s if m is even or \frac{m−1}{2} 2s and one 1 if m is odd to obtain a palindromic composition with a greater product. In this way, we see that there is no need for side parts of any size other than 1, 2, or 3.

Hence, a palindromic composition attaining the maximum product must have the form

P_{n} = 1^{a} · 2^{b} · 3^{c} · 5^{d}

where b and c are nonnegative integers and a and d are nonnegative integers such that 0 ≤ a ≤ 3 and 0 ≤ d ≤ 1.

Now let us assume that n ≥ 11. Suppose that d = 1, meaning that the center part λ is a 5. If there is a pair of 2s (one on either side of λ), then the subword (2, 5, 2) can be replaced with (3, 3, 3) to obtain a palindromic composition with a greater product. If there is not a pair of 2s, then there must be at least one pair of 3s (since n ≥ 11), in which case the subword (3, 5, 3) can be replaced with (2, 2, 3, 2, 2) to obtain a palindromic composition with a greater product. Therefore, the center part of a composition attaining P_{n} is not equal to 5 and we must have d = 0.

Suppose that the center part λ is a 1. If there is a pair of 3s (one on either side of λ), then the subword (3, 1, 3) can be replaced with (2, 3, 2) to obtain a palindromic composition with a greater product. If there is not a pair of 3s, then there must be at least two pairs of 2s (since n ≥ 11 and there is not more than one 1 on each side), in which case the subword (2, 2, 1, 2, 2) can be replaced with (3, 3, 3) to obtain a palindromic composition with a greater product. Therefore, the center part cannot be a 1; moreover, it must be true that a is even, i.e., a = 0 or a = 2. If a = 2, meaning there is one part of size 1 on each side of the center part, then the subword (1, 2, 2, 1) can be replaced with (3, 3) or the subword (1, 3, 3, 1) can be replaced with (2, 2, 2, 2). In either case, a palindromic composition with a greater product is attained. Therefore, the center part of a composition attaining P_{n} is not equal to 1 and we must have a = 0.

Since λ ≠ 1 and λ ≠ 5, there is no other choice but for the center part to be a 3, and since a = 0 and d = 0, the remaining parts of the composition must be either 2s or 3s:

P_{n} = 2^{b} · 3^{c}.

Since the center part is 3 and we must maintain the palindromic structure, b must be even. If b ≥ 6, then there are at least three 2s on each side of the center part, in which case the subword (2, 2, 2, 2, 2, 2) can be replaced with (3, 3, 3, 3). Therefore, either b = 0, b = 2, or b = 4. If b = 0, then 3c = n = 6j + 5 = 3(2j) + 2 for some integer j, which is a contradiction. If b = 2, then 4 + 3c = n = 6j + 5 and 3c = 6j + 1 = 3(2j) + 1 for some integer j, which is another contradiction. The only remaining possibility is that b = 4, in which case c = \frac{n−8}{3}.

3 Odd palindromic compositions

An odd palindromic composition of n is a palindromic composition containing only odd parts. For example, (1, 1, 3, 1, 1) is an odd palindromic composition of n = 7.

Theorem 3. The maximum part-product over all odd palindromic compositions of n, for n > 5, is

O_{n} = \begin{cases}M_{n}, & if n ≡ 0 (mod 3); \\ 3^{\frac{n−1}{3}} , & if n ≡ 1 (mod 6); \\ 3^{\frac{n−2}{3}} , & if n ≡ 2 (mod 6); \\ 25 · 3^{\frac{n−10}{3}} , & if n ≡ 4 (mod 6); \\ 5 · 3^{\frac{n−5}{3}} , & if n ≡ 5 (mod 6). \end{cases}

Note that M_{n} is again the maximum product defined in Lemma 1. By direct computation, O_{1} = 1, O_{2} = 1, O_{3} = 3, O_{4} = 1, and O_{5} = 5.

Proof. Consider an odd palindromic composition of n that attains the maximum product O_{n}. If such a composition contains a part of size m = 6j + ℓ ≥ 7, with ℓ = 1, 3, 5, then we can replace m by one ℓ and 2j 3s, which results in a greater product in each case while maintaining the palindromic structure. If m is a center part, then we can replace it with the part sequence (3, …, 3, ℓ, 3, …, 3) which again maintains the palindromic structure. Therefore, there is no need for parts of any size other than 1, 3, or 5 and an odd palindromic composition attaining the maximum product must have the form

O_{n} = 1^{a} · 3^{b} · 5^{c}

where a, b, and c are nonnegative integers.

Let λ be the center part of a composition attaining the maximum product. Suppose there are k parts of size 1 on either side of λ. Replace every three 1s (on each side) with a 3 instead. In other words, if k ≡ j (mod 3), replace the k parts of size 1 with \frac{k−j}{3} 3s and j 1s. In this way, we obtain a palindromic composition with a greater product, so there is no need for more than two 1s on either side of the center part and we must have 0 ≤ a ≤ 5.

Now suppose there are k parts of size 5 on either side of λ. Replace every two 5s (on each side) with three 3s and a 1 instead. In other words, if k ≡ j (mod 2), replace the k parts of size 5 with \frac{3(k−j)}{2} 3s, \frac{k−j}{2} 1s, and j 5s. In this way, we obtain a palindromic composition with a greater product, so there is no need for more than one 5 on either side of the center part and we must have 0 ≤ c ≤ 3.

We now consider several cases according to the value of n. In each case, there is a finite number of possible sets of part sizes that meet the restrictions on a and c and that, in addition, allow a palindromic composition of n to be constructed. For each set of part sizes, we choose a model arrangement that achieves a palindromic structure for the composition being constructed; however, note that there may also be other satisfactory arrangements. Specifically, we have the following five cases:

• If n ≡ 0 (mod 3), i.e., n = 3j, then there is an odd palindromic composition that attains the maximum product M_{n} from Lemma 1, namely the composition containing \frac{n}{3} 3s.

• If n ≡ 2 (mod 6), i.e., n = 6j + 2, then in particular n is even and there is no center part. Therefore, the possible values of a and c are a = 0, 2, 4 and c = 0, 2. However, only two of the six resulting combinations are feasible under the given restrictions. (To illustrate the reasoning, suppose a = 0 and c = 0. Then the composition must be composed of only 3s, yet n = 6j + 2 is not divisible by 3. Reasoning for the other combinations follows similarly but is not included here.) The feasible combinations are as follows:

a = 4 and c = 2, creating the subword (1, 1, 5, 5, 1, 1)

a = 2 and c = 0, creating the subword (1, 3, 3, 3, 3, 1)

Surrounding these two subwords are additional parts of size 3 to fill out the composition. The second subword has a greater product and therefore reveals the maximum partproduct to be O_{n} = 1^{2} · 3^{\frac{n−2}{3}} . Note that the subwords created in this case (and similar for each following case) have the same sum in order to enable direct comparison.

• If n ≡ 4 (mod 6), i.e., n = 6j + 4, then again n is even and there is no center part. Therefore, the possible values of a and c are again a = 0, 2, 4 and c = 0, 2. However, only two of the six resulting combinations are feasible under the given restrictions:

a = 0 and c = 2, creating the subword (5, 5)

a = 4 and c = 0, creating the subword (1, 1, 3, 3, 1, 1)

Surrounding these two subwords are additional parts of size 3 to fill out the composition. The first subword has a greater product and therefore reveals the maximum partproduct to be O_{n} = 3^{\frac{n−10}{3}} · 5^{2}.

• If n ≡ 1 (mod 6), i.e., n = 6j + 1, then in particular n is odd and must have a center part. Taking each possible choice of the center part λ (which can equal 1, 3, or 5) into consideration, there are six feasible combinations:

λ = 5, a = 4, and c = 2, creating the subword (1, 1, 5, 5, 5, 1, 1)

λ = 5, a = 2, and c = 0, creating the subword (1, 3, 3, 5, 3, 3, 1)

λ = 3, a = 0, and c = 2, creating the subword (5, 3, 3, 3, 5) λ = 3, a = 4, and c = 0, creating the subword (1, 1, 3, 3, 3, 3, 3, 1, 1)

λ = 1, a = 2, and c = 2, creating the subword (1, 5, 3, 1, 3, 5, 1)

λ = 1, a = 0, and c = 0, creating the subword (3, 3, 3, 1, 3, 3, 3)

Surrounding these six subwords are additional parts of size 3 to fill out the composition. The sixth subword has the greatest product and therefore reveals the maximum partproduct to be O_{n} = 1^{1} · 3^{\frac{n−1}{3}} .

• If n ≡ 5 (mod 6), i.e., n = 6j + 5, then again n is odd and must have a center part. Taking each possible choice of the center part λ into consideration, there are six feasible combinations:

λ = 5, a = 2, and c = 2, creating the subword (1, 5, 5, 5, 1)

λ = 5, a = 0, and c = 0, creating the subword (3, 3, 5, 3, 3)

λ = 3, a = 4, and c = 2, creating the subword (1, 1, 5, 3, 5, 1, 1)

λ = 3, a = 2, and c = 0, creating the subword (1, 3, 3, 3, 3, 3, 1)

λ = 1, a = 0, and c = 2, creating the subword (5, 3, 1, 3, 5)

λ = 1, a = 4, and c = 0, creating the subword (1, 1, 3, 3, 1, 3, 3, 1, 1)

Surrounding these six subwords are additional parts of size 3 to fill out the composition. The second subword has the greatest product and therefore reveals the maximum partproduct to be O_{n} = 3^{\frac{n−5}{3}} · 5^{1}.

4 Remarks

In his paper, Došlić analyzes partitions with distinct parts [3]. A natural extension to our results would be to consider palindromic compositions restricted by some suitable definition of “distinct parts.” For example, one could consider palindromic compositions that have distinct parts on either side of a center part, either allowing or disallowing the case when a composition has no center part. If a center part is required, a discernable pattern for the maximum part-product appears; however, the pattern is quite complex and its proof would certainly require a different approach than the method of cases employed in this paper.

References

[1] The On-Line Encyclopedia of Integer Sequences, published electronically at

   http://oeis.org, 2014.

[2] B. S. Beevers, The greatest product, Math. Gazette, 77 (1993), 91.

[3] T. Došlić, Maximum product over partitions into distinct parts, J. Integer Seq., 8 (2005), Article 05.5.8.

[4] T. N. T. Goodman, Notes: maximum products and lim (1 + \frac{1}{n})^{n} = e. Amer. Math. Monthly, 93 (1986), 638–640.

[5] S. Heubach and T. Mansour, Combinatorics of Compositions and Words, CRC Press, 2010.

[6] C. Shapcott, Part-Products of Random Integer Compositions, PhD thesis, Drexel University, 2012.

2010 Mathematics Subject Classification: Primary 05A17; Secondary 05A15. Keywords: integer composition, palindromic composition, odd composition, maximum product.

(Concerned with sequence \underline{A000792}.)

Received June 2 2014; revised versions received January 2 2015; January 4 2015. Published in Journal of Integer Sequences, January 25 2015.

Return to Journal of Integer Sequences home page.