Find the sum of all positive integers n where the mean and median of {20, 42, 69, n} are both integers.
In order for the mean to be an integer, the sum n + 20 + 42 + 69 must be divisible by 4. The latter three terms add to 131 so n must be congruent to 1 mod 4, and can be represented as 4k+1.
When n <= 20, the median is an integer.
When 20 < n <= 69, n would have to be even, but cannot be as it's 4k+1.
When n > 69 the median can't be an integer.
The only n that work are 1, 5, 9, 13 and 17.
The sum of these is 45.
|
Posted by Charlie
on 2025-01-08 08:58:53 |