1 votes 1 votes 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 asked Dec 20, 2017 • closed Jan 28, 2018 by Prateek kumar Ayush Upadhyaya 565 views comment Share Follow See all 5 Comments See all 5 5 Comments reply Ayush Upadhyaya commented Dec 20, 2017 reply Follow Share I am little doubtful with regard to below points. The equation I understood is d1 +d2 + d3+ d4+d5+d6=19 where each 0$\leq$di$\leq$9 (Actually answer comes when I take each di in this range) my query was why not each di will be in range 1$\leq$di$\leq$9 because question mentions for positive integers so each digit must be from 1 to 9. 1 votes 1 votes srestha commented Dec 20, 2017 reply Follow Share yes,that will be equation ans 42504? 0 votes 0 votes Manu Thakur commented Dec 20, 2017 reply Follow Share @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 votes 0 votes sid1221 commented Dec 20, 2017 reply Follow Share https://gateoverflow.in/85604/generalized-permutation-and-combination 0 votes 0 votes Ayush Upadhyaya commented Dec 21, 2017 reply Follow Share @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 votes 0 votes Please log in or register to add a comment.