How many positive integers under 1000 use only the digits 0, 1, 2 when written?
Hello, matgrl!
How many positive integers under 1000 use only the digits 0, 1, 2 when written?
I assume that leading zeros are not allowed.
We could write them out and count them . . . The answer is 26.
We can reason it out like this . . .
There are only 2 one-digit numbers: 1 and 2.
For two-digit numbers: there are 2 choices for the first digit
. . and 3 choices for the second.
There are: $\displaystyle 2 \times 3 \,=$ 6 two-digit numbers.
For three-digit numbers: there are 2 choices for the first digit,
. . 3 choices for the second,
. . and 3 choices for the third.
There are: $\displaystyle 2 \times 3 \times 3 \,=$ 18 three-digit numbers.
Therefore, there are: .$\displaystyle 2 + 6 + 18 \:=\:26$ such numbers.