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.
Let
n
b>1
Fb:N → N
Fb(n)=
k-1 | |
\sum | |
i=0 |
di
k=\lfloorlogb{n}\rfloor+1
b
di=
n\bmod{bi+1 | |
- |
n\bmodbi}{bi}
n
Fb
Fb(n)=n
All natural numbers
n
Fb
n\geqb
n=
k-1 | |
\sum | |
i=0 |
dibi
Fb(n)=
k-1 | |
\sum | |
i=0 |
di<
k-1 | |
\sum | |
i=0 |
dibi=n
b>1
n<b
Fb(n)=n
0\leqn<b
0\leqn<b
In base 12, 8 is the additive digital root of the base 10 number 3110, as for
n=3110
d0=
3110\bmod{120+1 | |
- |
3110\bmod120}{120}=
3110\bmod{12 | |
- |
3110\bmod1}{1}=
2-0 | |
1 |
=
2 | |
1 |
=2
d1=
3110\bmod{121+1 | |
- |
3110\bmod121}{121}=
3110\bmod{144 | |
- |
3110\bmod12}{12}=
86-2 | |
12 |
=
84 | |
12 |
=7
d2=
3110\bmod{122+1 | |
- |
3110\bmod122}{122}=
3110\bmod{1728 | |
- |
3110\bmod144}{144}=
1382-86 | |
144 |
=
1296 | |
144 |
=9
d3=
3110\bmod{123+1 | |
- |
3110\bmod123}{123}=
3110\bmod{20736 | |
- |
3110\bmod1728}{1728}=
3110-1382 | |
1728 |
=
1728 | |
1728 |
=1
F12(3110)=
4-1 | |
\sum | |
i=0 |
di=2+7+9+1=19
F12(3110)=19
d0=
19\bmod{120+1 | |
- |
19\bmod120}{120}=
19\bmod{12 | |
- |
19\bmod1}{1}=
7-0 | |
1 |
=
7 | |
1 |
=7
d1=
19\bmod{121+1 | |
- |
19\bmod121}{121}=
19\bmod{144 | |
- |
19\bmod12}{12}=
19-7 | |
12 |
=
12 | |
12 |
=1
F12(19)=
2-1 | |
\sum | |
i=0 |
di=1+7=8
F12(8)=8
We can define the digit root directly for base
b>1
\operatorname{dr}b:N → N
The formula in base
b
\operatorname{dr}b(n)=\begin{cases} 0&if n=0,\ b-1&if n ≠ 0, n \equiv0\pmod{(b-1)},\ n\bmod{(b-1)}&if n\not\equiv0\pmod{(b-1)} \end{cases}
\operatorname{dr}b(n)=\begin{cases} 0&if n=0,\ 1 + ((n-1)\bmod{(b-1)})&if n ≠ 0. \end{cases}
In base 10, the corresponding sequence is .
The digital root is the value modulo
(b-1)
b\equiv1\pmod{(b-1)},
bi\equiv1i\equiv1\pmod{(b-1)}.
i
di
dibi\equivdi\pmod{(b-1)}
n=d2b2+d1b1+d0b0
\operatorname{dr}b(n)\equivd2b2+d1b1+d0b0\equivd2(1)+d1(1)+d0(1)\equivd2+d1+d0\pmod{(b-1)}.
To obtain the modular value with respect to other numbers
m
i
bi\bmod{m}
m=2,5,and10
Also of note is the modulus
m=b+1
b\equiv-1\pmod{(b+1)},
b2\equiv(-1)2\equiv1\pmod{(b+1)},
(b+1)
It helps to see the digital root of a positive integer as the position it holds with respect to the largest multiple of
b-1
6-1=5
2035-1=2034|9
b-1
b-1
With this in mind the digital root of a positive integer
n
\lfloorx\rfloor
\operatorname{dr}b(n)=n-(b-1)\left\lfloor
n-1 | |
b-1 |
\right\rfloor.
a1+a2
b
a1
a2
a1-a2
b
a1
a2
(b-1)
-n
b
a1 ⋅ a2
b
b
a1 ⋅ a2
b
a1
a2
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
b
n
n
n
0, 10, 19, 199, 19 999 999 999 999 999 999 999, ... 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.
The example below implements the digit sum described in the definition above to search for digital roots and additive persistences in Python.
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.