Nice Problem!

How many three digit numbers are there whose sum of the digits is odd?


The answer is 450.

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

Akhil Bansal
Jul 24, 2015

Let xyz be the number whose sum of digits is odd.
There are 4 possible case possible.
1) x is even ,y is even and z is odd = 4 × 5 × 5 4\times5\times5 = 100 ways.
2) x is even ,y is odd and z is even = 4 × 5 × 5 4\times5\times5 = 100 ways.
3) x is odd , y is even and z is even = 5 × 5 × 5 5\times5\times5 = 125 ways.
4) x is odd ,y is odd , z is odd = 5 × 5 × 5 5\times5\times5 = 125 ways.
Hence,add result of above cases,we get total 450 \boxed{450} ways.


Akhil, Can you please explain how we find the number of ways for each of the possibilities. (I didn't understand these steps: 4 × 5 × 5 4\times5\times5 =100 ways... )

Vignesh Rao - 5 years, 5 months ago

Log in to reply

For this, you have to understand rule of product

Akhil Bansal - 5 years, 5 months ago

Log in to reply

Ok Thank You.

Vignesh Rao - 5 years, 5 months ago
Cleres Cupertino
Aug 21, 2015

There are 900 three digit numbers. The half of them the sum is odd and the other half is even.

I seriously like this solution of yours Cleres.

Vignesh Rao - 5 years, 5 months ago
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
def sum_of_digits(n):
    ans = 0
    while n:
        ans += (n%10)
        n /= 10
    return ans    

ctr = 0
for n in range(100, 1000):
    if sum_of_digits(n) % 2 != 0:
        ctr += 1

print ctr        

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...