## Digit Sum

#### Problem

The digits in the number, 42, add to six. There are exactly six 2-digit numbers with this property: 15, 24, 33, 42, 51, and 60.

How many 3-digit numbers exist for which the sum of the digits is six?

#### Solution

There are exactly twenty-one 3-digit numbers for which the sum of the digits is six:

105, 150, 501, 510

114, 141, 411

123, 132, 213, 231, 312, 321

204, 240, 402, 420

222

303, 330

600

Can you see how this list was produced?

What about 4-digit numbers with this property?

What about numbers below 10000?

Can you generalise for up to `n`-digit numbers?

Problem ID: 206 (17 Feb 2005) Difficulty: 1 Star