1 1 vote closed as a duplicate of: Generalized permutation and combination How many positive integers less than 1,000,000 have the sum of their digits equal to 19? Combinatory generating-functions combinational-circuit + – Ayush Upadhyaya 1.1k views comment Share Follow Print See all 5 Comments 5 5 Comments reply Show 2 previous comments Manu Thakur commented Dec 20, 2017 reply Follow flag @Ayush it's because 1 digit number can be written as 00000 or 000001 or 0000002 or so on.. I mean, 000 289 = 19 is also a possibility. 0 0 replyShare sid1221 commented Dec 20, 2017 reply Follow flag https://gateoverflow.in/85604/generalized-permutation-and-combination 0 0 replyShare Ayush Upadhyaya commented Dec 21, 2017 reply Follow flag @Srestha-No it's 30492. I think Why di ranges from 0 to 9 because Firstly the question says "the sum of digits must be 19" so with all zeroes, I cannot have sum as 19 (so obviously there would be a positive integer whose sum of digit would be 19) and since with up to 6 digits, each digit can range from 0 to 9 only that's why each di is from 0 to 9. 0 0 replyShare Please log in or register to add a comment.