The digit sum of a nonnegative integer in a specified radix is the sum of its numerical digits. Ifwrite , with . For example, . In binary representation, the digit sum is the Hamming weight of the digit string.
Since , the positional expansion givesIn decimal representation, this yields the familiar divisibility tests by and : the integer and its digit sum have the same remainder modulo either. For , both and leave remainder modulo . The argument explains the rule from modular arithmetic, rather than relying on a pattern noticed in examples.
The digit sum, also known as the sum of digits, is calculated by adding together all the individual digits of a given number. For instance, if you take the number 1234, the digit sum would be calculated as follows: 1 + 2 + 3 + 4 = 10 In this case, the digit sum of 1234 is 10. The concept is often used in various areas of mathematics, including number theory and numerical analysis.
New to topics? Read the docs here!