The digit sum of a non-negative integer to be the sum of its digits.

For example, the digit sum of \(1+2+3=6 \)a) How many positive integers less than 100 have a digit sum equal to \(8\)?

Let n be a positive integer less than \(10\)

b) How many positive integers less than 100 have a digit sum equal to \( n \)?

c) How many positive integers less than 1000 have a digit sum equal to \( n \)?

d) How many positive integers from \(500\)-\(999\) have a digit sum equal to \(8\)?

e) How many positve integers less than \(1000\) have a digit sum equal to \(8\), and one digit at least \(5\)?

f) What is the total the digit sums of the integers from \(0\) to \(999\) inclusive?

a) \((0,8)(1,7)(2,6)(3,5)\)… \((6,2)(7,1)(8,0)=9\) integers

b) \((0,n)(1, n-1)(2, n-2)(3, n-3)\)… \((n-1,1)(n,0)= n+1\) integers

c) \([(0,0,n)… (0,n,0)] + [(1,0,n-1)… (1,n-1,0)] +…….+[(n,0,0)]\)

\(=[n+1]\) ways \(+ n\) ways \(+ [n-1]\) ways \(+…. +1\) way

\(=(n+1)(n+2)/2\) integers

d) \([(5,0,3)…(5,3,0)] + [(6,0,2)…(6,2,0))] + [(7,0,1)((7,1,0)] + [(8,0,0)]\)

\(= 4 + 3 + 2 + 1 = 10 \) integers

e) \(10\) ways \(1^{st}\) digit \( ⩾ 5 + 10 \) ways \(2^{nd}\) digit \(⩾ 5 + 10 \) ways \(3\) digit \(⩾ 5\)

\(=30\) integers

f) \(1000\) numbers implies \(0-9\) appear in each column \(100\) times

\(=(0+1+2+3+…+8+9) \times3 \times100=13500\) total