First we should consider how many positive integers less than 100 have digit sum equal to n. The answer should be relatively straight forward for this - it is n+1.For example, if n = 3 then we can have 03,12,21,30, so 4 numbers in total.We shall use this result in our question.
Then we need to consider the following observations:If the number ABC has digit sum equal to n, then the number BC would have digit sum less than n.If B+C is less than n, we can find a unique A such that A+B+C = nsince n<10, the unique A must be a single-digit number.Combining the 3 facts together we can deduce that the number of 3-DIGIT numbers with digit sum n = 1+2....+n (i.e the sum of 2-digit numbers with digit sum less than n) = (n+1)n/2so finally we need to add the number of 2-or-1-digit numbers with digit sum n to the formula above, so the answer is(n+1)n/2 + (n+1) = (n+1)(n+2)/2