Split 2018

Algebra Level 5

Find the value of n n such that the sum of positive integers a 1 , a 2 , , a n a_1,a_2,\cdots,a_n is 2018 and the product of these integers is maximized.


Bonus: Generalize this for the sum of positive integer N . N.


The answer is 673.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Mark Hennings
Dec 16, 2018

Note that 2 ( a 2 ) > a 2(a-2) > a when a > 4 a > 4 , and that a + 1 > a × 1 a+1 > a\times1 . Also note that 2 3 < 3 2 2^3 < 3^2 , while 2 + 2 + 2 = 3 + 3 2+2+2=3+3 .

Firstly, there are only finitely many ways of writing a positive integer N N as a sum of positive integers (there can only be at most N N such integers, and none of them can exceed N N ). Thus there does indeed exist a maximum integer M M such that M M can be written as a product of positive integers which add to N N . Suppose that a 1 , a 2 , a 3 , . . . , a n a_1,a_2,a_3,...,a_n are positive integers that add to N N and multiply to M M .

If a 1 > 4 a_1 > 4 then we could replace a 1 a_1 by a 1 2 a_1-2 and 2 2 , obtaining another set of positive integers that add to N N , but with a larger product. Since this is not possible, we deduce that a 1 4 a_1 \le 4 . Similarly, a j 4 a_j \le 4 for all j j . If a 1 = 1 a_1 = 1 we could discard a 1 a_1 and replace a 2 a_2 by a 2 + 1 a_2+1 , obtaining a larger product. This is not possible, and so a 1 2 a_1 \ge 2 . Similarly a j 2 a_j \ge 2 for all j j . Since 4 = 2 + 2 = 2 × 2 4 = 2+2 = 2\times2 , we can, without loss of generality, assume that no a j a_j is equal to 4 4 (otherwise we could replace it with two 2 2 s). Thus we deduce that a j = 2 , 3 a_j = 2,3 for all j j . Finally, since 2 3 < 3 2 2^3 < 3^2 , we deduce that there can only be at most two 2 2 s in the list. To sum up, the list of numbers a 1 , a 2 , . . . , a n a_1,a_2,...,a_n can only contain 2 2 s and 3 3 s, and can contain at most two 2 2 s in addition.

If N = 3 m N = 3m , then the only way these conditions can be satisfied is if n = m n = m and a j = 3 a_j = 3 for all 1 j m 1 \le j \le m , making M = 3 m M = 3^m .

If N = 3 m + 1 N = 3m+1 , then the only way these conditions can be satisfied is if n = m + 1 n = m+1 and a j = 3 a_j = 3 for 1 j m 1 1 \le j \le m-1 , with a m = a m + 1 = 2 a_m=a_{m+1} = 2 (or a reordering of these numbers), making M = 4 × 3 m 1 M = 4 \times 3^{m-1} . In this case, it is also possible that n = m n=m , with a j = 3 a_j=3 for 1 j m 1 1 \le j \le m-1 and a m = 4 a_m = 4 , up to reordering.

If N = 3 m + 2 N = 3m+2 , then the only way these conditions can be satisfied is if n = m + 1 n=m+1 and a j = 3 a_j=3 for 1 j m 1 \le j \le m , with a m + 1 = 2 a_{m+1} = 2 (or a reordering of these numbers), making M = 2 × 3 m M = 2 \times 3^m .

In the case N = 2018 = 3 × 672 + 2 N = 2018 = 3\times672+2 , we obtain n = 672 + 1 = 673 n = 672+1=\boxed{673} .

I agree with your analysis, except in one point: If N = 3 m + 1 N=3m+1 , then n n could be m m or m + 1 m+1 , since one of the a j a_j could be 4. Your earlier assumption "that no a j a_j is equal to 4" is a bit premature.

Otto Bretscher - 2 years, 5 months ago

Log in to reply

Fair enough. The standard version of this question asks for M M , not n n , and in that case we can exclude the possibility of 4 4 altogether.

Mark Hennings - 2 years, 5 months ago

Nice solution. I got the correct solution by guess work.

Srikanth Tupurani - 2 years, 5 months ago

I've seen this exact problem but with 20 and not 2018. I think it was a really old MATHCOUNTS problem or an AMC 10/12 problem.

Razzi Masroor - 1 year, 4 months ago

Log in to reply

it is a really old problem, whatever the number you want to use. It's only a bit boring if the target number is a mutliple of 3 3 .

Mark Hennings - 1 year, 4 months ago

Log in to reply

This is off-topic though can you prove that ( v ( 1 , 1 ) + v ( 1 , 2 ) + . . . + v ( 1 , n ) ) ( v ( 2 , 1 ) + v ( 2 , 2 ) + . . . + v ( 2 , n ) ) . . . ( v ( n , 1 ) + v ( n , 2 ) + . . . + v ( n , n ) ) n v ( 1 , 1 ) v ( 2 , 1 ) . . . v ( n , 1 ) n + v ( 1 , 2 ) v ( 2 , 2 ) . . . v ( n , 2 ) n + . . . + v ( 1 , n ) v ( 2 , n ) . . . v ( n , n ) n \sqrt[n]{ ( v_{(1, 1)}+v_{(1, 2)}+...+v_{(1, n)} ) ( v_{(2, 1)}+v_{(2, 2)}+...+v_{(2, n)} ) ... ( v_{(n, 1)}+v_{(n, 2)}+...+v_{(n, n)} ) } \geq \sqrt[n]{ v_{(1, 1)}v_{(2, 1)}...v_{(n, 1)} } + \sqrt[n]{ v_{(1, 2)}v_{(2, 2)}...v_{(n, 2)} } +...+ \sqrt[n]{ v_{(1, n)}v_{(2, n)}...v_{(n, n)} } with Cauchy-Shwartz or even a generalization of Cauchy? I was trying to see if the RM-AM-GM-HM could be proved using only Cauchy Shwartz and some variable manipulation. I got the RM-AM and AM-HM easily and I showed that GM-HM is just AM-GM but with the reciprocals of the elements. The inequality I am asking you about proves AM-GM by letting v ( 1 , 1 ) , v ( 1 , 2 ) , . . . , v ( 1 , n ) v_{(1, 1)},v_{(1, 2)},...,v_{(1, n)} be the elements and the other n-1 n-tuples could just be the first n-tuple but shifted over by some number. For example you could use the above equation to prove that ( a + b + c ) ( b + c + a ) ( c + a + b ) 3 a b c 3 + b c a 3 + c a b 3 \sqrt[3]{(a+b+c)(b+c+a)(c+a+b)} \geq \sqrt[3]{abc}+\sqrt[3]{bca}+\sqrt[3]{cab} which can be rearranged into AM-GM for 3 variables.

Razzi Masroor - 1 year, 4 months ago
Eric Nordstrom
May 20, 2019

@Mark Hennings ' explanation is way better, but the way I did it was by treating n n and all the terms as any positive real number instead of just integers and finding that, firstly, for any given n n the product is maximized when all terms are the same value, which means the product is p = ( N n ) n p=\left(\frac{N}{n}\right)^n , and secondly that this product is maximized when n = N e n=\frac{N}{e} --i.e. each term is e e , which is between 2 and 3; closer to 3. This is enough to make an educated guess by making as many terms as possible equal 3 and letting the other two be 2, so since we had 3 tries, that is basically what I did. See comments below for details.

To see that the product is maximized when all terms are the same, we can imagine starting with all terms as different values. To change the values incrementally so the product increases while maintaining the sum of N N , at least one term has to increase, and at least one term has to decrease. The simplest process is therefore to choose only one term a i a_i to increase and one other term a j a_j to decrease. With only these two terms are changing, their sum is fixed at a value of N rem N-\sum_\text{rem} , where rem \sum_\text{rem} is the sum of all the other terms. Solving one of the two terms for the other gives a j = N rem a i a_j=N-\sum_\text{rem}-a_i , and their product a i ( N rem a i ) a_i(N-\sum_\text{rem}-a_i) expresses a parabola which opens downward and has roots 0 and N rem N-\sum_\text{rem} . For each pair of terms, the product is maximized when they are both at the vertex of this parabola, and the product is finally maximized when this is true of all pairs of terms, which requires that they all have the same value of N n \frac{N}{n} .

Finding the optimal term value then requires calculus:

d d n ( N n ) n = d d n e n ln ( N / n ) = [ ln ( N n ) + n N / n ( N n 2 ) ] ( N n ) n = 0 ln ( N n ) = 1 N n = e \frac{d}{dn}\left(\frac{N}{n}\right)^n=\frac{d}{dn}e^{n\ln(N/n)}=\left[\ln \left(\frac{N}{n}\right)+\frac{n}{N/n}\left(\frac{-N}{n^2}\right)\right]\left(\frac{N}{n}\right)^n=0\\ \ln \left(\frac{N}{n}\right)=1\\ \boxed{\frac{N}{n}=e}

This seems to show that all terms should be as close to e e as possible, but it doesn't really prove it. Once we require that n n be a whole number, everything changes. Is it more important for the terms to be as close together as possible or for n n to be as close to N e \frac{N}{e} as possible? Is it possible to find local maxima of p p for whole-number terms and n n that are not very close to the term value of e e ? My way of getting some more certainty in my solution did not really answer these questions but was to assume the set of terms would consist of 2's and 3's, to let α \alpha be the number of 2's, to let β \beta be the number of 3's, and then to determine when the product is maximized:

2 α + 3 β = N β = N 2 α 3 2\alpha+3\beta=N\\ \beta=\frac{N-2\alpha}{3}

p = 2 α 3 N 2 α 3 = 2 α + log 2 3 3 ( N 2 α ) = 2 ( 1 2 log 2 3 3 ) α + log 2 3 3 N p=2^\alpha 3^\frac{N-2\alpha}{3}=2^{\alpha+\frac{\log_2 3}{3}(N-2\alpha)}=2^{(1-\frac{2\log_2 3}{3})\alpha+\frac{\log_2 3}{3}N} ,

which is a decreasing function since 1 2 log 2 3 3 < 0 1-\frac{2\log_2 3}{3}<0 . Therefore, the product seems to be maximized when as few 2's are used as possible.

To really prove it, I think we could take a bunch of partial derivatives p a i \frac{\partial p}{\partial a_i} and find patterns in solving the huge systems of equations that would result, but I don't feel like doing all that. If anyone has a better way (aside from @Mark Hennings' way), please comment!

Eric Nordstrom - 2 years ago
Mukesh Ramanathan
May 27, 2019

For any set of positive numbers that have a fixed sum, the maximum product is achieved when they are the same number (or as close to being the same as possible). An excellent/ probably better proof for this is given by @Eric Nordstrom but the way I think of it is (perhaps more intuitive/visual) given the perimeter of the sides of a shape, the maximum volume/area is achieved when the sides are the same length.

An example for n=2 : Maximise the area of the rectangle with side lengths a and b, given that the perimeter is 2x.

We know a + b = x and we need to maximise ab. Through substitution: ab = a(x-a) , which has a maximum at a= x/2 so b = x/2. This can also be shown for larger n.

Therefore a good start is to let all the numbers equal 2018 n \frac{2018}{n} so we need to maximise ( 201 8 n n n \frac{2018^{n}}{n^{n}} )

d d n \frac{d}{dn} ( 201 8 n n n \frac{2018^{n}}{n^{n}} ) = l n ( 2018 ) × 201 8 n 201 8 n × ( l n ( n ) + 1 ) n n \frac{ln(2018) \times 2018^{n} - 2018^{n} \times (ln(n)+1)}{n^{n}} solving for d d n \frac{d}{dn} ( 201 8 n n n \frac{2018^{n}}{n^{n}} ) = 0, gives n = 2018 e \frac{2018}{e} so the maximum value is given when n = 742.3807123... and all the numbers in the set are e but n and a must be integers so we need to let as many integers be as close to e as possible.

Since 3 is the closest integer to e, we let as many numbers be 3 before the sum exceeds 2018: so there are 672 3's in the set. 672 × 3 672 \times 3 = 2016 so we can have 2 1's or a 2 but 2> 1 × 1 1 \times 1 so we choose 2 and hence there are 673 numbers in the set

Obviously I like this line of thinking since it's the way I did it, but I haven't even completed the proof, and @Mark Hennings ' explanation is vastly more effective. But this method does shine some light on the problem that the other method doesn't in that it shows the relation to e e , which I think is fascinating.

Eric Nordstrom - 2 years ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...