Integers between 1 and 1000000 will be 1,2,3,4,5 or 6 digits.
And given the sum of digits =18
Thus we need to obtain the number of solutions of the equation
x1+x2+x3+x4+x5+x6=18...(1)
where 0≤xi≤9,i=1,2,3,4,5,6
Therefore, the number of solutions of the equation (1), will be
=Coefficient of x18 in (x0+x1+x2+x3+...+x9)6
=Coefficient of x18 in (1−x101−x)6
=Coefficient of x18 in (1−x10)6(1−x)−6
=Coefficient of x18 in (1−6x10)(1+ 6C1x+ 7C2x2+...+ 13C8x8+...+ 23C18x18+...)
=23C18−6. 13C8
=23C5−6. 13C5
=23.22.21.20.191.2.3.4.5−6.13.12.11.10.9.1.2.3.4.5
=33649−7722
=25927