DigitSum
The sum of the digits of n in the given base (default 10).
DigitSum(n)sum of the digits of DigitSum(n, base)sum of the digits of Details
- Equivalent to summing IntegerDigits(n, base).
- In base 2, the digit sum is the number of set bits (population count).
in base 10 -- the basis of the classic divisibility-by-9 check and digital root. - The sign of n is discarded before summing.
- compute-engine only supports the 2-argument form.
Examples
See also: DigitCount