The digital root (also repeated digital sum) of a natural number in a given radix is the (single digit) value obtained by an iterative process of summing digits, on each iteration using the result from the previous iteration to compute a digit sum. The process continues until a single-digit number is reached. For example, in base 10, the digital root of the number 12345 is 6 because the sum of the digits in the number is 1 + 2 + 3 + 4 + 5 = 15, then the addition process is repeated again for the resulting number 15, so that the sum of 1 + 5 equals 6, which is the digital root of that number. In base 10, this is equivalent to taking the remainder upon division by 9 (except when the digital root is 9, where the remainder upon division by 9 will be 0), which allows it to be used as a divisibility rule.
We can define the digit root directly for base in the following ways:
The formula in base is:
or,
In base 10, the corresponding sequence is (sequence A010888 in the OEIS).
The digital root is the value modulo because and thus So regardless of the position of digit , , which explains why digits can be meaningfully added. Concretely, for a three-digit number ,
To obtain the modular value with respect to other numbers , one can take weighted sums, where the weight on the -th digit corresponds to the value of . In base 10, this is simplest for , where higher digits except for the unit digit vanish (since 2 and 5 divide powers of 10), which corresponds to the familiar fact that the divisibility of a decimal number with respect to 2, 5, and 10 can be checked by the last digit.
Also of note is the modulus . Since and thus taking the alternating sum of digits yields the value modulo .
- The digital root of in base is the digital root of the sum of the digital root of and the digital root of :
This property can be used as a sort of checksum, to check that a sum has been performed correctly.
- The digital root of in base is congruent to the difference of the digital root of and the digital root of modulo :
- The digital root of in base is
- The digital root of the product of nonzero single digit numbers in base is given by the Vedic Square in base .
- The digital root of in base is the digital root of the product of the digital root of and the digital root of :
The additive persistence counts how many times we must sum its digits to arrive at its digital root.
For example, the additive persistence of 2718 in base 10 is 2: first we find that 2 + 7 + 1 + 8 = 18, then that 1 + 8 = 9.
There is no limit to the additive persistence of a number in a number base . Proof: For a given number , the persistence of the number consisting of repetitions of the digit 1 is 1 higher than that of . The smallest numbers of additive persistence 0, 1, ... in base 10 are:
- 0, 10, 19, 199, 19 999 999 999 999 999 999 999, ... (sequence A006050 in the OEIS)
The next number in the sequence (the smallest number of additive persistence 5) is 2 × 102×(1022 − 1)/9 − 1 (that is, 1 followed by 2 222 222 222 222 222 222 222 nines). For any fixed base, the sum of the digits of a number is proportional to its logarithm; therefore, the additive persistence is proportional to the iterated logarithm.[1]
The example below implements the digit sum described in the definition above to search for digital roots and additive persistences in Python.
def digit_sum(x: int, b: int) -> int:
total = 0
while x > 0:
total = total + (x % b)
x = x // b
return total
def digital_root(x: int, b: int) -> int:
seen = set()
while x not in seen:
seen.add(x)
x = digit_sum(x, b)
return x
def additive_persistence(x: int, b: int) -> int:
seen = set()
while x not in seen:
seen.add(x)
x = digit_sum(x, b)
return len(seen) - 1
Digital roots are used in Western numerology, but certain numbers deemed to have occult significance (such as 11 and 22) are not always completely reduced to a single digit.
Digital roots form an important mechanic in the visual novel adventure game Nine Hours, Nine Persons, Nine Doors.
- Averbach, Bonnie; Chein, Orin (27 May 1999), Problem Solving Through Recreational Mathematics, Dover Books on Mathematics (reprinted ed.), Mineola, NY: Courier Dover Publications, pp. 125–127, ISBN 0-486-40917-1 (online copy, p. 125, at Google Books)
- Ghannam, Talal (4 January 2011), The Mystery of Numbers: Revealed Through Their Digital Root, CreateSpace Publications, pp. 68–73, ISBN 978-1-4776-7841-1, archived from the original on 29 March 2016, retrieved 11 February 2016 (online copy, p. 68, at Google Books)
- Hall, F. M. (1980), An Introduction into Abstract Algebra, vol. 1 (2nd ed.), Cambridge, U.K.: CUP Archive, p. 101, ISBN 978-0-521-29861-2 (online copy, p. 101, at Google Books)
- O'Beirne, T. H. (13 March 1961), "Puzzles and Paradoxes", New Scientist, 10 (230), Reed Business Information: 53–54, ISSN 0262-4079 (online copy, p. 53, at Google Books)
- Rouse Ball, W. W.; Coxeter, H. S. M. (6 May 2010), Mathematical Recreations and Essays, Dover Recreational Mathematics (13th ed.), NY: Dover Publications, ISBN 978-0-486-25357-2 (online copy at Google Books)