Try this beautiful problem from the Pre-RMO, 2017 based on Average and Integers.
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, find the maximum sum of the two removed numbers.
Average
Integers
Maximum
Answer: is 51.
PRMO, 2017, Question 15
Elementary Algebra by Hall and Knight
\(\frac{{n(n+1)}{2}-(2n-1)}{n-2}\)<17<\(\frac{{n(n+1)}{2}-3}{n-2}\)
\(\Rightarrow \frac{n^{2}+n-4n+2}{2(n-2)}<17<\frac{n^{2}+n+6}{2(n-2)}\)
\(\Rightarrow \frac{n-1}{2}<17<\frac{n+3}{2}\)
\(\Rightarrow n<35 and n>31\)
\(\Rightarrow\) n=32,33,34
First case n=32 \(\frac{\frac{n(n+1)}{2}-p}{(n+2)}\)=17
\(\Rightarrow\) p=18
Second case, n=33 \(\Rightarrow\) p=34
Third case, n=34 \(\Rightarrow\) p=51.