Determine the smallest integer $n > 0$ for which
- the sum of the decimal digits of $n$ is divisible by $20$,
- $n$ is divisible by $20$.
Question inspired by Divisible by seventeen.
Puzzling Stack Exchange is a question and answer site for those who create, solve, and study puzzles. It only takes a minute to sign up.Sign up to join this community
The answer is
The number must end in 0 and the other digits must add up to 20 (at least). Since $9+9<20$, the number must have at least four digits. It cannot begin with 1 since the maximum sum of the digits is $1+9+9 < 20$ and it cannot begin with 2 since $2+9+9=20$ but 2990 is not divisible by 20. Therefore $n > 3000$. Since $3+8+9=20$ is the only possible sum under these constraints (i.e, $n$ begins with 3 ends in 0 and the digit sum is 20), the first number that works is 3980.
We must have 00, 20, 40, 60 or 80 as its last two digits to be divisible by 20.
For the smallest number we'll want 80 to kick off the digit sum as large as possible.
We now need smallest number of digits that sum with 8 to to give 20.
That's 2 digits: 6, 6 or 7, 5 or 8, 4 or 9, 3.
Of those pairs want the one with the lowest integer to take the thousand's place.
That's 9 and 3 so we have 3980.