SOLUTION: How many positive integers are there less than 800 such that all the digits are odd?

Algebra ->  Permutations -> SOLUTION: How many positive integers are there less than 800 such that all the digits are odd?      Log On


   



Question 515151: How many positive integers are there less than 800 such that all the digits are odd?
Answer by drcole(72) About Me  (Show Source):
You can put this solution on YOUR website!
This is a bit tricky, because we need to deal with numbers with 1 digit, 2 digits, and 3 digits.
First, there are five positive one-digit integers with only odd digits: 1, 3, 5, 7, and 9. So these are included in our set.
Second, we note that all two-digit positive integers are less than 800, so we can just ask how many two-digit positive integers only have odd digits. We have five choices for the tens digit (1, 3, 5, 7, and 9) and five choices for the ones digit (also 1, 3, 5, 7, and 9). Any combination will work, so this gives us 5 * 5 = 25 two-digit positive integers with only odd digits.
Finally, we move on to three-digit positive integers. Not every three-digit positive integer is less than 800: to be less than 800, the hundreds digit must be less than 8. So we only have four choices for the hundreds digit (1, 3, 5, and 7). For the tens and ones digits, we have five choices each (1, 3, 5, 7, and 9). Any combination from these choices will work, so there are 4 * 5 * 5 = 100 three-digit positive integers less than 800 with only odd digits.
So, altogether, there are 5 + 25 + 100 = 130 positive integers less than 800 such that all the digits are odd.