*** Welcome to piglix ***

Digit sum


In mathematics, the digit sum of a given integer is the sum of all its digits (e.g. the digit sum of 84001 is calculated as 8+4+0+0+1 = 13). Digit sums are most often computed using the decimal representation of the given number, but they may be calculated in any other base. Different bases give different digit sums, with the digit sums for binary being on average smaller than those for any other base.

The digit sum of a number in base is given by

.


...
Wikipedia

...