how many positive integers less than 9,000 are there in which the sum of the digits equals 5 ?
"basically , the question asks how many 4 digit numbers ( including those in the form 0 xxx , 00 xx , and 000 x ) have digits which add up to 5 . think about the question this way : we know that there is a total of 5 to be spread among the 4 digits , we just have to determine the number of ways it can be spread . let x represent a sum of 1 , and | represent a seperator between two digits . as a result , we will have 5 x ' s ( digits add up to the 5 ) , and 3 | ' s ( 3 digit seperators ) . so , for example : xx | x | x | x = 2111 | | xxx | xx = 0032 etc . there are 8 c 3 ways to determine where to place the separators . hence , the answer is 8 c 3 = 56 . a"
divide(factorial(subtract(add(const_4, 5), const_1)), multiply(factorial(5), factorial(subtract(const_4, const_1))))