Seven positive integers, mean = 5, median = 4, and two modes 2 and 8.
Since there are an odd number of numbers and 4 is a median, at least one of the numbers is 4 and three of the numbers must be larger than 4 and three of the numbers must be smaller than 4.
Since both 2 and 8 are modes, either both are used twice or both are used 3 times.
When I tried to use them three times, I couldn't get anything to work.
So, using them twice, I have 2, 2, 4, 8, 8, giving a sum of 24.
For seven numbers to have a mean of 5, their sum must be 7 x 5 = 35.
I need another 11, split between a number smaller than 4 and a number larger than 4.
If I try 3 for the smaller number, this means that I have to use 8 for the larger number, but I can't because that would mess up the modes.
If the number is 1, than the other number must be 10.
1, 2, 2, 4, 8, 8, 10