   SEARCH HOME Math Central Quandaries & Queries  Question from Marcel: Hello. My question is the following: Given the set {1,2...........10exp2019}, how many numbers from the set have the sum of its digits equal to 2? I got some of them : 2 20 200 2000 20000 .......2. 10exp2018 11 110 1100 11000 110000....101 1010 10100 101000 1010000....10011 10010 100100 1001000 1010000.....10001 100010 1000100 10001000,,,,,,100001 1000010 10000100....... My problem is that I have difficulty in finding a strategy to obtain the exact quantity of numbers. Please help me, thanks Hi Marcel,

First of all, what you have already noticed is that if you have a collection of digits and the sum of the digits is 2 then either one of the digits is 2 an the rest are 0 or two of the digits are 1 and the rest are 0.

One digit numbers:
The only one digit number that satisfies you requirements is 2. Hence there is only 1, one digit number that satisfies your requirement.

Two digit numbers:
If one of the digits is 2 and the other is 0 the only possibility is 20. If both digits are 1 then the only possibility is 11. Hence there are 2, two digit number that satisfies your requirement.

Three digit numbers:
If one of the digits is 2 and the others are 0 the only possibility is 200. If two of the digits are 1 then the leading digit (the hundreds digit) must be 1. The second 1 can appear in two places giving 110 and 101. Hence there are 3, three digit number that satisfies your requirement.

Let's jump to $n$ digit numbers, that is numbers from $10^n$ to $10^{n+1} -1.$

$n$ digit numbers:
If one of the digits is 2 and the others are 0 then there is only possibility is 2 followed by $n-1$ zeros. If two of the digits are 1 then the leading digit must be 1. The second 1 can appear in $n-1$ places. Hence there are n, n digit number that satisfies your requirement.

Does this help?

Penny     Math Central is supported by the University of Regina and The Pacific Institute for the Mathematical Sciences.