Using the numbers $0,1,2,3,4,5,6,7$ (repetition allowed) how many odd numbers can be created which will be less than $10000$? 
Using the numbers $0,1,2,3,4,5,6,7$ (repetition allowed) how many odd numbers can be created which will be less than $10000$?

I have tried to solve this in the following way:
Numbers which will be less than $10000$ must be one digit, two digits, three digits, or four digits (like $1,13,123,1235$ etc).
Therefore, one-digit odd numbers $=4$.
Two-digit odd numbers possible $=32-4=28$ (as there can be one zero)
Three-digit odd numbers possible $=256-28-4=224$ (again there can be two zeros)
Four-digit odd numbers possible $=2048-228-28-4=1788$ (as there can be three zeros)
Therefore, total possible numbers will be $=4+28+224+1788=2044$
But the book says the answer is $2048$.
Could you please solve this?
 A: Your count for four-digit odd numbers is incorrect.
The thousands place can be filled in seven ways since the leading digit cannot be $0$.  The hundreds place can be filled in eight ways since any digit is permitted.  The tens place can also be filled in eight ways for the same reason.  The units digit can be filled in four ways since only the odd digits $1, 3, 5, 7$ are permitted.  Hence, there are $7 \cdot 8 \cdot 8 \cdot 4 = 1792$.  With that correction, you will obtain the stated answer of $2048$.
Alternate Method:  Notice that any number less than $10000$ can be expressed as a four-digit string by appending leading zeros as necessary.  For instance, we can represent $17$ by the string $0017$.
With that in mind, we can fill the first three places in the string in eight ways since any digit is permitted and the units digit in four ways since only odd digits are permitted, giving $8 \cdot 8 \cdot 8 \cdot 4 = 2048$ odd numbers less than $10000$ that can be formed using the digits $0, 1, 2, 3, 4, 5, 6, 7$ with repetition.
A: You can see your problem as a combinatory one: 
As you said only 4 digits numbers are allowed. The only restriction required for your number to be odd is to have its last digit being either 1,3,5 or 7. For the 3 remaining digits, all 0,1,2,3,4,5,6,7 are possible.
Therefore you have 8 possibilities for each of your 3 first digits and 4 possibilities for your last digit. 
Thus you have in total 8*8*8*4 possibilities which is equal to 2048.
A: If you have Mathematica here is a way to check your answer. As it has been pointed out the mistake is in the number of four-digit odd numbers. 
a[n_] := 
  If[ContainsNone[IntegerDigits[n], {8}] && 
    ContainsNone[IntegerDigits[n], {9}] && OddQ[n], 1, 0];
Total[a /@ Table[i, {i, 1000, 9999}]]
