Can you just simply add numbers?

Determine the sum of all 4-digit numbers, all the digits of which are odd.

Bonus - Generalize it for n n -digit numbers.


The answer is 3471875.

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.

3 solutions

Ravi Dwivedi
Aug 1, 2015

There are 5 5 ways to choose the first digit, 5 5 ways to choose the 2 2 nd digit, 5 5 ways to choose the third digit and 5 5 ways to choose the fourth digit.

There are 5 4 = 625 5^4=625 4 4 -digit numbers having only odd digits.

Each of 1 , 3 , 5 , 7 , 9 1,3,5,7,9 occurs 125 125 times.

Therefore the sum of all the units digits is 125 × ( 1 + 3 + 5 + 7 + 9 ) = 125 × ( 25 ) = 3125 125\times (1+3+5+7+9) = 125\times (25) = 3125 .

Sum of tens digits is 3125 × 10 3125\times 10

Sum of hundreds and thousands digits are respectively 3125 × 100 3125\times 100 and 3125 × 1000 3125 \times 1000

Sum of all such 4 digit numbers = 3125 + 3125 × 10 + 3125 × 100 + 3125 × 1000 = 3471875 3125+3125\times 10+3125\times 100+3125\times 1000=\\ \boxed{3471875}\\

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 5^n n n -digit numbers having the desired property.

Each of 1 , 3 , 5 , 7 , 9 1,3,5,7,9 occurs 5 n 5 = 5 n 1 \frac{5^n}{5}=5^{n-1} times

Sum of units digit = 5 n 1 × ( 1 + 3 + 5 + 7 + 9 ) = 5 n + 1 5^{n-1}\times(1+3+5+7+9)=5^{n+1}

Similarly we can do for tens, hundreds upto 1 0 n 1 10^{n-1} .

Answer= 5 n + 1 + 10 × 5 n + 1 + 100 × 5 n + 1 + . . . + 1 0 n 1 × 5 n + 1 5^{n+1}+10\times5^{n+1}+100\times5{n+1}+...+10^{n-1}\times5^{n+1} and we are done

Moderator note:

Simple standard approach.

Note that the generalized answer can still be simplified.

Nice solution. The generalized form can be simplified to, 5 n + 1 × 1 0 n 1 9 5^{n+1}\times \frac {10^n-1}{9}

MD Omur Faruque - 5 years, 9 months ago
Shubham Bhargava
Jul 29, 2015

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


Moderator note:

Simple standard approach.

Do you also know the generating function approach?

We have 5 3 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 1+3+5+7+9=5^{2} and is the same in all digits.

Hence, we have 5 5 × 1111 = 3471875 5^{5} \times 1111=\boxed{3471875}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...