Google

2002 and 2003 - solution

Give feedback

Find the smallest positive integer which can be represented both as a sum of 2002 positive integers each with the same sum of digits, and as a sum of 2003 positive integers each with the same sum of digits.

Assuming the integers do not need to be unique.

First notice that if we have n integers with a certain sum of digits, and if we change one of them to a different integer (still with the given sum of digits), then the sum of the n integers must have changed by a multiple of 9, because the difference between two integers with the same sum of digits is always a multiple of 9.

So, if we have two such sets of integers, like in the given problem, then the difference between their sums can be brought to 0 (by changing some integers to other integers) only if their original difference was a multiple of 9.

So, for example, if one set is 2002 integers with 6 as sum of digits, then the other set must be 2003 integers with 3 as sum of digits, because 2002×6 - 2003×3 = 0 mod 9.

So, to find two such sets with the same sum (the difference of the sums is zero) and where the sum is the smallest possible, we find after checking the possibilities that one of the sum of digits must be at least 5. So one set must be 2002×5, and then we make up the other set from 2003 integers with 4 as sum of digits, and that could for example be done by 4 and 13, so (2003-x)×4 + 13x = 10010. Thus x = 222.

Thus the smallest sum is 10010 given by 2002×5 and 1781×4 + 222×13.