My head hurts

How many positive integers less than 10,000 are there in which the sum of the digits equals 5?


The answer is 56.

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

Mridul K Ojha
Jul 2, 2015

The total combinations of 4-digit no. to give 5 are:

0,0,0,5; 0,0,2,3; 1,1,1,2; 0,0,1,4; 0,1,1,3

Therefore total ways are : 4!/3! + 4!/2! + 4!/3! + 4!/2! + 4!/2!

= 4+12+4+12+12 = 56

Akshat Sharda
Jun 27, 2015

1-99: 5, 14, 41, 23, 32, 50 100-199: the 100th digit is 1, it means the sum of the other two is 4, so these are the combinations of 04, 13, 22 = 2+2+1=5 200-299: the sum of the other two is 3, combinations of 03, 12 = 2+2= 4 300-399: the sum of the other two is 2, combinations of 02, 11 =2+1=3 400-499: the sum of the other two is 1 , combinations of 01 =2 500: 1 1000-1999: the sum of the three is 4, combinations of 004, 013, 022, 112= 3+6+3+3=15 2000-2999: the sum of the three is 3, combinations of 003, 012, 111 = 3+6+1=10 3000-3999: the sum of the three is 2, combinations of 002, 011= 3+3=6 4000-4999: the sum of the three is 1, combinations of 001 = 3 5000: 1

adding them all together= 6+5+4+3+2+1+15+10+6+3+1=56

Moderator note:

There's a much simpler approach. Hint: Stars and Bars .

Stars and bars approach: we have to separate 5 stars into 4 groups, the number of stars in each group representing the value of the corresponding digit in the result. This boils down to placing 3 bars between 5 stars in a row to separate them into 4 groups. So on 5 + 3 = 8 positions, we have to place 3 bars and 5 stars. The number of ways to do this is ( 8 3 ) = 56 \binom{8}{3} = 56 .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...