When Yann removes 4 of the n integers from his list, there are n−4 integers left.
Suppose that the sum of the n−4 integers left is T.
The average of these n−4 integers is 89.5625=89.5+0.0625=89+21+161=89169=161433.
Since the sum of the n−4 integers is T, then n−4T=161433 which means that 16T=1433(n−4).
Since 1433 and 16 have no common divisor larger than 1 (the positive divisors of 16 are 1, 2, 4, 8, 16, none of which other than 1 is a divisor of 1433), the value of n−4 is a multiple of 16.
Since 100<p<q<r<s, the original list includes more than 100 numbers.
Since the original list includes consecutive integers starting at 1 and only 4 of more than 100 numbers are removed, it seems likely that the average of the original list and the average of the new list should be relatively similar.
Since the average of the new list is 89.5625 which is close to 90, it seems reasonable to say that the average of the original list is close to 90.
Since the original list is a list of consecutive positive integers starting at 1, this means that we would guess that the original list has roughly 180 integers in it.
In other words, n appears to be near 180.
We do know that n−4 is a multiple of 16. The closest multiples of 16 to 180 are 160, 176 and 192, which correspond to n=164, n=180, and n=196.
Suppose that n=180, which seems like the most likely possibility. We will show at the end of the solution that this is the only possible value of n.
The equation n−4T=89.5625 gives T=176×89.5625=15763.
The sum of the n integers in the original list is 1+2+3+4+⋯+(n−1)+n=21n(n+1) When n=180, the sum of the integers 1,2,3,…,178,179,180 is 21(180)(181)=16290.
Since the sum of the numbers in the original list is 16290 and the sum once the four numbers are removed is 15763, the sum of the four numbers removed is 16290−15763=527.
In other words, p+q+r+s=527.
We now want to count the number of ways in which we can choose p, q, r, s with the conditions that 100<p<q<r<s≤180 and p+q+r+s=527 with at least three of p, q, r, s consecutive.
The fourth of these integers is at least 101 and at most 180, which means that the sum of the three consecutive integers is at least 527−180=347 and is at most 527−101=426.
This means that the consecutive integers are at least 115,116,117 (whose sum is 348) since 114+115+116=345 which is too small and smaller integers will give sums that are smaller still.
If p, q, r equal 115, 116, 117, then s=527−348=179.
The consecutive integers are at most 141,142,143 (whose sum is 426) since 142+143+144=429 which is too large and larger integers will give sums that are larger still.
If p, q, r equal 141, 142, 143, then s=527−426=101.
When each of the three consecutive integers is increased by 1 and the sum is constant, the fourth integer is decreased by 3 to maintain this constant sum.
Using all of this, we obtain the following lists p, q, r, s: 115,116,117,179 ; 116,117,118,176 ; … ; 130,131,132,134 128,132,133,134 ; 125,133,134,135 ; … ; 101,141,142,143 Note that we cannot use 131, 132, 133, 131, since p, q, r, s must be distinct.
There are 26 lists of integers that can be removed (16 in the first set and 10 in the second set).
The corresponding values of s are: 179,176,173,170,167,164,161,158,155,152,149,146,143,140,137,134 134,135,136,137,138,139,140,141,142,143 There are 4 values of s that overlap between the two lists, and so there are 26−4=22 possible values for s.
Why is n=180 the only possible value of n?
To see this, we use the fact that the average of the list of consecutive integers starting at a and ending at b equals the average of a and b, or 2a+b. (This is true because the integers in the list have a constant difference and are thus evenly distributed, which means that the average of the first and last integers will equal the average of all of the integers in the list.)
The original list of integers is 1,2,…,n−1,n which has an average of 2n+1.
If the four largest integers are removed from the list, the new list is 1,2,…,n−5,n−4, which has an average of 2n−3.
If the four smallest integers are removed from the list, the new list is 5,6,…,n−1,n, which has an average of 2n+5.
When any four integers are removed, the sum of the remaining integers is greater than or equal to the sum of 1,2,…,n−5,n−4 and less than or equal to the sum of 5,6,…,n−1,n. Since the denominator in the average calculation remains the same, the average of any of the lists after four numbers are removed is at least 2n−3 and at most 2n+5.
This means that the actual average (which is 89.5625) is greater than or equal to 2n−3 and less than or equal to 2n+5.
Since 89.5625≥2n−3, then n−3≤179.125 and so n≤182.125.
Since 89.5625≤2n+5, then n+5≥179.125 and so n≥174.125.
Since n is an integer, then 175≤n≤182 and so 171≤n−4≤178.
Since n−4 is a multiple of 16, then n−4=176 and so n=180, as required.
(The correct answer was missing from the original version of the problem.)