Determine the sum of all 4-digit numbers, all the digits of which are odd.
Bonus - Generalize it for n -digit numbers.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Simple standard approach.
Note that the generalized answer can still be simplified.
Nice solution. The generalized form can be simplified to, 5 n + 1 × 9 1 0 n − 1
Since all the digits have to be odd, we are limited to 1, 3, 5, 7 and 9 as digits.
There are 5 possibilities for each digit which means there are totally 625 possible numbers. The average of each digit of each number is 5 which means that the average of all these odd digit numbers is 625.
Average=Sum/Number of items
5555=x/625
x=625*5555
=3471875
Simple standard approach.
Do you also know the generating function approach?
We have 5 3 ways to vary the another digits except for the one we consider.
Since all digit is an odd number, so, the sum is 1 + 3 + 5 + 7 + 9 = 5 2 and is the same in all digits.
Hence, we have 5 5 × 1 1 1 1 = 3 4 7 1 8 7 5
Problem Loading...
Note Loading...
Set Loading...
There are 5 ways to choose the first digit, 5 ways to choose the 2 nd digit, 5 ways to choose the third digit and 5 ways to choose the fourth digit.
There are 5 4 = 6 2 5 4 -digit numbers having only odd digits.
Each of 1 , 3 , 5 , 7 , 9 occurs 1 2 5 times.
Therefore the sum of all the units digits is 1 2 5 × ( 1 + 3 + 5 + 7 + 9 ) = 1 2 5 × ( 2 5 ) = 3 1 2 5 .
Sum of tens digits is 3 1 2 5 × 1 0
Sum of hundreds and thousands digits are respectively 3 1 2 5 × 1 0 0 and 3 1 2 5 × 1 0 0 0
Sum of all such 4 digit numbers = 3 1 2 5 + 3 1 2 5 × 1 0 + 3 1 2 5 × 1 0 0 + 3 1 2 5 × 1 0 0 0 = 3 4 7 1 8 7 5
Generalization for n digit numbers
In this case we need to find the sum of all n-digit numbers ,all the digits of which are odd.
There are 5 n n -digit numbers having the desired property.
Each of 1 , 3 , 5 , 7 , 9 occurs 5 5 n = 5 n − 1 times
Sum of units digit = 5 n − 1 × ( 1 + 3 + 5 + 7 + 9 ) = 5 n + 1
Similarly we can do for tens, hundreds upto 1 0 n − 1 .
Answer= 5 n + 1 + 1 0 × 5 n + 1 + 1 0 0 × 5 n + 1 + . . . + 1 0 n − 1 × 5 n + 1 and we are done