In mathematics, the digit sum of a natural number in a given number base is the sum of all its digits. For example, the digit sum of the decimal number 9045 {\displaystyle 9045} would be 9 + 0 + 4 + 5 = 18. {\displaystyle 9+0+4+5=18.}