Problem 12 · Happy numbers
Three-digit numbers equal to 19 times their digit sum.
Integer answer, at most 4 digitsA positive three-digit integer is called happy if dividing it by the sum of its digits gives 19. What is the sum of all happy numbers?
Reasoned solution
Key idea: a happy number is $n = 19s$, where $s$ is its digit sum. We only need to sweep the possible values of $s$.
Since $n$ has three digits, $100 \le 19s \le 999$ gives $6 \le s \le 52$; but the digit sum of a three-digit number is at most $27$. Hence $s \in \{6, \dots, 27\}$.
We check which $19s$ have digit sum exactly $s$. For $s = 6, 7, \dots, 15$ they all work:
(for instance $114 = 19\cdot 6$ and $1+1+4 = 6$ ✓). For $s = 16, \dots, 20$ and $s = 22, \dots, 27$ it fails (e.g. $19 \cdot 16 = 304$ has digit sum $7 \ne 16$), and for $s = 21$ it works: $399 = 19 \cdot 21$ with $3+9+9 = 21$ ✓.
The required sum: the first ten form an arithmetic progression with common difference 19,