Theorem
A number is congruent to its digit sum modulo
Arithmetic • Number System • Divisibility
Formula
For any positive integer with digits : , because and so every power of is . The same congruence holds modulo .
How to use it
- 1Repeat the digit sum until one digit remains; that digital root is the remainder modulo , except that a root of means remainder .
- 2Use it to reduce a huge base before raising it to a power modulo .
- 3It is the source of the familiar tests: exactly when divides the digit sum, and exactly when does.
Worked example
What is the remainder when is divided by ?
Step-by-step
- 1
Why: Sum the digits.
- 2
Why: Repeat until a single digit remains.
- 3
Answer
Watch out
Only moduli and work this way, because only for those is . Modulo the digits must be taken with alternating signs, and for any other modulus the digit sum says nothing at all.