$N$ is the smallest positive integer such that the sum of the digits of $N$ is 18 and the sum of the digits of $2N$ is $27$. Find $N$.
My workings so far:
If $N$ had two digits, then $N$ must equal $99$. However, the sum of the digits of $99\times 2$ does not equal $27$. Therefore, $N$ must have at least three digits.
Assume $N$ has three digits. Denote its digits by $a, b, c, \dots$ if their values are $0, 1, 2, 3,$ or $4$ $(a\neq 0$), and by $A, B, C, \dots$ if their values are $5, 6, 7, 8,$ or $9$.
The possibilities for $N$ are $abc, abC, aBc, Abc, ABc, AbC, aBC,$ or $ABC$. We can ignore the first four cases, as their maximum sum does not exceed 18. For the last four cases, 2N will respectively equal:
$[1][2A-9][2B-10][2c], [1][2A-10][2b+1][2C-10], [2a+1][2B-9][2C-10],$ and $[1][2A-0][2B-9][2C-10]$
(where square brackets represent individual digits)
Given these numbers, based on the fact that $N$'s digits add to 18, the digit sums of the above cases are $18, 18, 18,$ and $9$ respectively.
Suppose $N$ is a four-digit number....
I don't know how to continue from here. Maybe we could make a mock 'number' like above, but how would we calculate the digit sums of those cases?