Last verified · v1.0
Calculator · math
Digital Root Calculator
Compute the digital root, digit sum, or additive persistence of any non-negative integer using the closed-form modular formula or step-by-step iteration.
Inputs
Result
—
Explain my result
Get a plain-English breakdown of your result with practical next steps.
The formula
How the
result is
computed.
What Is a Digital Root?
The digital root of a non-negative integer is the single-digit value produced by repeatedly summing its digits until only one digit remains. Starting with 493, the first iteration yields 4 + 9 + 3 = 16, and the second yields 1 + 6 = 7, producing a digital root of 7. This process, described formally in Wolfram MathWorld's Digital Root reference, always converges to a single digit in the range 0 to 9, regardless of how large the starting number is. The digital root is also called the repeated digital sum or iterated digit sum.
The Closed-Form Digital Root Formula
Repeated iteration is straightforward but inefficient for very large integers. A direct closed-form formula computes the digital root in a single arithmetic step with no iteration required:
- dr(0) = 0
- dr(n) = 1 + ((n − 1) mod 9), for all integers n > 0
This expression leverages the relationship between base-10 positional notation and the number 9. Because 10 ≡ 1 (mod 9), every power of 10 satisfies 10k ≡ 1 (mod 9) as well. Consequently, the positional weight of each digit collapses under modular reduction, and any integer n becomes congruent modulo 9 to the sum of its digits. The subtraction of 1 followed by addition of 1 corrects the single edge case where multiples of 9 would otherwise return 0 instead of the correct answer 9.
Mathematical Derivation
Write n in base-10 as n = ak × 10k + … + a1 × 10 + a0, where each ai is a digit from 0 to 9. Since 10 ≡ 1 (mod 9), each term reduces to ai (mod 9), giving n ≡ ak + … + a1 + a0 (mod 9). Applying this reduction recursively yields the same result as summing digits repeatedly. The formula dr(n) = 1 + ((n − 1) mod 9) expresses the entire process as a single operation valid for all positive integers.
Worked Examples
- n = 0: dr(0) = 0 by definition.
- n = 7: dr(7) = 7 (already a single digit).
- n = 9: 1 + (8 mod 9) = 1 + 8 = 9 — confirms multiples of 9 map to 9, not 0.
- n = 18: 1 + (17 mod 9) = 1 + 8 = 9. Check: 1+8=9.
- n = 493: 1 + (492 mod 9) = 1 + 6 = 7. Check: 4+9+3=16, 1+6=7.
- n = 12,345: 1 + (12344 mod 9) = 1 + 5 = 6. Check: 1+2+3+4+5=15, 1+5=6.
- n = 999,999: 1 + (999998 mod 9) = 1 + 8 = 9. Check: digit sum = 54, 5+4=9.
Digit Sum vs. Digital Root
The digit sum is a single-pass operation that adds all digits of a number exactly once. The digit sum of 7,865 is 7 + 8 + 6 + 5 = 26. The digital root continues the process until a single digit results: 2 + 6 = 8. The digit sum can be any non-negative integer, while the digital root is always a single digit from 0 to 9. This calculator provides both computations, as well as additive persistence, for maximum utility.
Additive Persistence
As catalogued in OEIS A031286, the additive persistence of n counts how many digit-summing iterations are needed before the number reduces to a single digit. A number that is already a single digit has additive persistence 0. The number 199 requires three iterations — 1+9+9=19, then 1+9=10, then 1+0=1 — giving it an additive persistence of 3. Exploring large integers for high persistence values is a recognized challenge in recreational mathematics; the smallest integer with additive persistence 4 is 19,999,999,999,999,999,999,999.
Practical Applications
Divisibility Testing
The digital root provides an immediate divisibility check rooted in the congruence n ≡ digit-sum (mod 9). Any integer whose digital root equals 9 is divisible by 9. Any integer whose digital root equals 3, 6, or 9 is divisible by 3. These rules make digital roots an invaluable tool for quick mental arithmetic checks and estimation tasks.
Casting Out Nines: Arithmetic Verification
Before electronic computers, accountants and mathematicians used digital roots to verify addition and multiplication through a technique called casting out nines. To verify a + b = c, compute the digital roots of a, b, and c: the digital root of (dr(a) + dr(b)) must equal dr(c). A mismatch reveals an arithmetic error. The method reliably detects transposition errors and single-digit mistakes, making it one of the oldest and most effective manual verification techniques.
Number Theory, Check Digits, and Recreational Mathematics
The sequence of digital roots for the positive integers, documented in OEIS A010888, repeats with a period of exactly 9: 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, … This periodicity underpins applications across number theory and recreational mathematics, from the construction of magic squares to the analysis of Kaprekar routines. Weighted variants of the digit sum form the basis of the Luhn algorithm used in credit card validation, and related techniques appear in ISBN check-digit systems and barcode integrity verification.
Reference