Question
Question: Integers 1, 2, 3, ..., n, where n > 2 are written on a board. Two numbers m, k such that 1 < m < n, ...
Integers 1, 2, 3, ..., n, where n > 2 are written on a board. Two numbers m, k such that 1 < m < n, 1 < k < n are removed and the average of the remaining numbers is found to be 17. What is the maximum sum of the two removed numbers?

51
Solution
Let the sum of numbers be Sn=2n(n+1). Let the two removed numbers be m and k. Constraints: 2≤m,k≤n−1 and m=k. The sum of remaining numbers is Sn−(m+k). The average of remaining numbers is 17: n−2Sn−(m+k)=17. Substitute Sn: n−2n(n+1)/2−(m+k)=17. Let X=m+k. X=2n(n+1)−17(n−2)=2n2+n−34n+68=2n2−33n+68. The minimum possible value for X is 2+3=5. The maximum possible value for X is (n−1)+(n−2)=2n−3. So, 5≤2n2−33n+68≤2n−3.
- 10≤n2−33n+68⟹n2−33n+58≥0. Roots are 233±857≈1.865,31.135. Since n>2, n≥32.
- n2−33n+68≤4n−6⟹n2−37n+74≤0. Roots are 237±1073≈2.125,34.875. So 3≤n≤34.
Combining n≥32 and 3≤n≤34, we get 32≤n≤34. The function X(n)=2n2−33n+68 is an upward-opening parabola with axis of symmetry at n=16.5. For n∈{32,33,34}, the function is increasing. Therefore, the maximum value of X occurs at n=34. For n=34: X=2342−33(34)+68=234(34−33)+68=234+68=2102=51. For n=34, the allowed range for m, k is 2≤m,k≤33. A sum of 51 is achievable (e.g., m=25,k=26).
The final answer is 51.