Since the median is 13, the middle (5th) value must be 13. Numbers to the left must be 13 or smaller; numbers to the right must be 13 or greater. Call the last number in the sequence x. Since we want x to be as large as possible, we want all of the other numbers to be as small as possible:
0 0 0 0 13 13 13 13 x
The median = 13
The mean = 13 = (4·13 + x)/9
Solve for x. If the numbers in the data set cannot repeat (distinct?), then the sequence would be:
0 1 2 3 13 14 15 16 x
The median is still 13. The mean is:
(0+1+2+3+13+14+15+16+x)/9 = 13
Solve for x.