# Find whole numbers of which's average is given

I was trying to calculate something, when I came across with something I couldn't solve. I needed to "reverse an average", find whole numbers, of which's average is 0,625. I feel like this is a thing that must be brute forced, check every possible combination. What would the most effective way to write an algorithm that performs a reverse average search?

• Any partition of 625 into 1000 numbers, e.g. 0+0+...0+625, is a solution. – Marcus Ritt Apr 30 at 21:58

$$0.625 = \frac58$$ so you need $$8k$$ integers which add up to $$5k$$ for some positive integer $$k$$ to get this exactly
$$\{0,0,0,0,0,0,0,5\}$$ is a simple example, as is $$\{0,0,0,1,1,1,1,1\}$$, but there are many more