Find all possible numbers with specific mean, median and range Given that there are $20$ positive numbers and that the median is $42$, mean is $46$ and the range is $35$.
An important condition, I missed: A number can appear at the most two times.
This was indeed question asked in my sister's class (6th grade). She solved it by setting
$$x_1, x_2, x_9 \dots 42, 42, y_1, y_2 \dots y_9$$ and found three solutions and got her assignment correct.
The values she got was 
$$30, 30, 31, 31, 32, 32, 33, 33, 34, 42, 42, 43, 61, 62, 63, 63, 64, 64, 65, 65$$
$$30, 30, 31, 31, 32, 32, 33, 33, 34, 42, 42, 55, 55, 56, 63, 63, 64, 64, 65, 65$$
$$30, 30, 31, 31, 32, 32, 33, 33, 34, 42, 42, 51, 54, 62, 63, 63, 64, 64, 65, 65$$
I looked at this question and seemed interesting to ask what are all possible solutions?
I am therefore seeking an approach to find all possible solutions.
I attempted by listing a possibility (there could be more)
$$x, x, x_1, x_2, x_3, x_4, x_5, x_6, x_7, 42, 42, y_7, y_6, y_5, y_4, y_3, y_2, x_1, x+3, x+35$$
where $x_i < 42, $ and $y_i > 42$ and $7 < x < 42$
By doing a little more work, I could come with the smallest value of $x=29$. Is that correct?  
 A: If we want the lowest element $x$ to be as small as possible while still keeping the mean fixed, then all the other elements should be as large as possible. However, the middle two elements are fixed at $42$. (They could be, say, $41$ and $43$, but one can verify that this doesn't improve the solution.) So, given that not more than two elements can be the same, the sequence should look something like this:
$$x, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, y-4, y-3, y-3, y-2, y-2, y-1, y-1, y, y$$
The range is specified to be $35$, so $y = x + 35$, which gives us
$$x, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, x+31, x+32, x+32, x+33, x+33, x+34, x+34, x+35, x+35$$
What this is, is the largest possible sequence which starts at $x$ and satisfies the conditions on the median and range. Any other sequence starting at $x$ cannot have elements larger than this. In particular, the mean of any sequence starting at $x$ is at most the mean of this sequence, which is $\frac1{20}(699 + 10x)$.
Now we want the mean to be $46$. So $46 = \text{mean} \le \frac1{20}(699 + 10x)$, or $x \ge 22.1$. As $x$ must be an integer, we set $x = 23$, getting the maximum possible sequence as
$$23, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 54, 55, 55, 56, 56, 57, \
57, 58, 58$$
whose mean is $46 \frac9{20}$. Then we just subtract $9$ from a convenient element to get the mean we want:
$$23,38,38,39,39,40,40,41,41,42,42,45,55,55,56,56,57,57,58,58$$
A: 19, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 54, 54, 54, 54, 54, 54, 54, 54, 54 shows the smallest number can be 19, and from the form of this solution it's clear it can't be less. 
EDIT: This is if we read the problem too fast and don't notice the bit that says, "A number can appear at the most two times."
