1.

How many integers between 1 and 1000000 have the sum of the digit equal to 18?

Answer» Integers betweenn 1 and 1000000 will be 1,2,3,4,5 or 6 digits and given sum of digit=18
Thus, we need to obtain the number of solutions of the equation
`x_(1)+x_(2)+x_(3)+x_(4)+x_(5)+x_(6)=18` . . . (i)
where, `0 lt x_(i) le 9, i=1,2,3,4,5,6`
Therefore, the number of solutions of Eq. (i) will be
=Coefficient of `x^(18)` in `(x^(0)+x^(1)+x^(2)+x^(3)+ . . .+x^(9))^(6)`
=Coefficient of `x^(18)` in `((1-x^(10))/(1-x))^(6)`
=Coefficient of `x^(18)` in `(1-x^(10))^(6)(1-x)^(-6)`
=Coefficient of `x^(18)` in `(1-6x^(10))(1+.^(6)C_(1)x+.^(7)C_(2)x^(2)+ . . .+.^(13)C_(8)x^(8)+ . . .+.^(23)C_(18)x^(18)+ . . .)`
`=.^(23)C_(18)-6*.^(13)C_(8)=.^(23)C_(5)-6*.^(13)C_(5)`
`=(23*22*21*20*19)/(1*2*3*4*5)-6*(13*12*11*10*9)/(1*2*3*4*5)`
`=33649-7722=25927`


Discussion

No Comment Found

Related InterviewSolutions