Digit sum

From Wikipedia, the free encyclopedia

In mathematics, the digit sum of a given integer is the sum of all its digits, e.g. the digit sum of 12042 is calculated as 1+2+0+4+2 = 9. This concept is closely related to, but not the same as, the digital root, which is the result of repeatedly applying the digit sum operation until the remaining value is only a single digit.

The digital root of a base 10 integer, x, can be calculated as digital_root(x) = x mod 9. For example, digital_root(632) would reduce 6+3+2 = 11 to 1+1 = 2. The function returns 0 when the digit sum is 9 (or 0 as in the case of digital_root(0)). This is also called "casting out nines".

Using alternating addition and subtraction, rather than addition alone, produces residues modulo eleven. The least significant digit should be added, the 10s digit subtracted, and so on, making it more convenient to work right-to-left. Thus 12042 produces 2−4+0−2+1 = −3, or 8 modulo 11.

Digit sums (digital roots) are useful for checking arithmetic operations of addition, subtraction, multiplication and squaring. It can also be used for quotient/remainder division. There is a limitation to this method, when an answer has error/s totalling a 9 multiple (17 x 19 = 323 but if incorrectly written as 17 x 19 = 413) then using digit sums will not reveal that the answer is in error.

[edit] External links


 This number theory-related article is a stub. You can help Wikipedia by expanding it.
In other languages