Let be a sequence of distinct positive integers such that and is maximized. If , compute the largest positive integer such that .
Solution
We claim that the optimal set is . We first show that any optimal set is either of the form or , for some . Without loss of generality, assume that the sequence has the maximum product. Suppose . Then, increasing by 1 and decreasing by 1 will increase the product , contradicting the assumption that the sequence has the optimal product. Thus, any "gaps" in the can only have size 1. Now, we show that there can only be one such gap. Suppose , and , for . Then, we can increase by 1 and decrease by 1 to increase the total product. Thus, there is at most one gap, and the sequence is of one of the forms described before. We now show that either or . Consider any set of the form or . If , then we can remove and increase by 1 to increase the product. If , then we can remove and replace it with 2 and to increase the product. Thus, we have , or 4. Suppose . If the next element is 5, we can replace it with a 2 and a 3 to increase the product, and if the next element is 6, we can replace it with a 1,2, and 3 without making the product any smaller. Thus, we can assume that either or . The nearest triangular number to 2021 is . Using this, we can compute that if , our set must be , leading to a product of . If , our set is , leading to a product of . Thus, the maximum product is . We now compute the highest power of 2 that divides this expression. 64! includes 32 elements that contribute at least one power of 2,16 that contribute at least two powers of 2, and so on until the one element that contributes at least six powers of 2. This means the highest power of 2 that divides 64! is . Finally, dividing by 58 removes one of these powers of 2, making the answer 62.