Remainder by Digit Sum
Find the remainder of \(7345821\) when divided by \(9\), without long division.
Use \(10\equiv1\pmod9\).
The digit sum is \(7+3+4+5+8+2+1=30\). Since \(30\equiv3\pmod9\), the original number also has remainder \(3\).
Chapter
Theory
Digit problems are almost always congruence problems. A decimal representation is an expansion in powers of \(10\), and a representation in base \(b\) is an expansion in powers of \(b\). Thus divisibility rules, last digits, and decimal periods should be translated into residues.
The main move is this: if \(N=a_k10^k+\cdots+a_1 10+a_0\), then modulo \(m\) we may replace \(10\) by its residue. For example, modulo \(9\) we have \(10\equiv1\), modulo \(11\) we have \(10\equiv-1\), and the last \(r\) digits are determined by the residue modulo \(10^r\).
If the problem mentions a sum of digits, try modulo \(9\) or \(3\). If an alternating digit sum, symmetry, or an even-length palindrome appears, check modulo \(11\). If last digits of a power are required, work modulo \(10^r\) and find the residue cycle.
If the statement contains a number of the form \(111\ldots111\), rewrite it as \(R_n=\frac{10^n-1}{9}\). Divisibility often becomes the condition \(10^n\equiv1\pmod m\).
Examples
A basic example: the divisibility rule for \(9\) is proved, not memorised.
Problem. Prove that a number \(N\) and the sum of its decimal digits have the same remainder modulo \(9\).
Let \(N=a_k10^k+\cdots+a_1 10+a_0\). Since \(10\equiv1\pmod9\), we have \(10^i\equiv1\pmod9\) for all \(i\). Hence \(N\equiv a_k+\cdots+a_1+a_0\pmod9\).
Comment. This is why divisibility by \(9\) is tested by the digit sum.
Modulo \(11\) appears because \(10\equiv-1\pmod{11}\).
Problem. Check whether \(583946\) is divisible by \(11\).
Compute the alternating sum from the right: \(6-4+9-3+8-5=11\). It is divisible by \(11\), so \(583946\) is divisible by \(11\).
Comment. The signs must alternate consistently; direction affects only the sign of the final sum.
The last two digits are the residue modulo \(100\).
Problem. Find the last two digits of \(7^{50}\).
Since \(7^4=2401\equiv1\pmod{100}\), \(7^{50}=7^{4\cdot12+2}\equiv7^2\equiv49\pmod{100}\). The last two digits are \(49\).
Comment. The actual cycle is often shorter than Euler's theorem suggests.
Translating into an expression in the base removes ambiguity.
Problem. Find all bases \(b>6\) for which \((253)_b\) is divisible by \(7\).
We have \((253)_b=2b^2+5b+3\). Modulo \(7\), solve \(2b^2+5b+3\equiv0\). Checking residues \(b\pmod7\), we get \(b\equiv4\pmod7\). Since \(b>6\), all bases are \(b=7t+4\), \(t\ge1\).
Comment. Remember the base condition: all digits must be smaller than the base.
The period of \(\frac{1}{m}\) is linked to the order of \(10\) modulo \(m\).
Problem. Find the period length of \(\frac{1}{7}\).
We need the least \(k>0\) such that \(10^k\equiv1\pmod7\). The residues are \(10\equiv3\), \(10^2\equiv2\), \(10^3\equiv6\), \(10^4\equiv4\), \(10^5\equiv5\), \(10^6\equiv1\pmod7\). Thus the period is \(6\).
Comment. This is not long division; it is a residue cycle.
A repunit turns the problem into a congruence for a power of \(10\).
Problem. Prove that \(111111\) is divisible by \(7\), \(11\), and \(13\).
We have \(111111=R_6=\frac{10^6-1}{9}\). Also \(1001=7\cdot11\cdot13\), and \(111111=111\cdot1001\). Hence the number is divisible by \(7\), \(11\), and \(13\).
Comment. Sometimes block factorisation is easier than direct work with a long decimal.
The condition \(R_n\mid R_m\) is connected to divisibility of the indices.
Problem. Prove that if \(a\mid b\), then \(R_a\mid R_b\).
Let \(b=qa\). Then \(R_b=1+10+\cdots+10^{b-1}\). Split the sum into blocks of length \(a\): \(R_b=R_a(1+10^a+10^{2a}+\cdots+10^{(q-1)a})\). Therefore \(R_a\mid R_b\).
Comment. The converse needs more work and is usually proved through the order of \(10\).
This is the first important example where the pigeonhole principle appears.
Problem. Prove that for every \(m\) coprime to \(10\), there exists a number consisting only of ones that is divisible by \(m\).
Consider the \(m\) numbers \(R_1,R_2,\ldots,R_m\). If one is divisible by \(m\), we are done. Otherwise two have the same residue: \(R_i\equiv R_j\pmod m\), \(i
Comment. This move constructs a multiple without explicitly finding it.
Problems
Find the remainder of \(7345821\) when divided by \(9\), without long division.
Use \(10\equiv1\pmod9\).
The digit sum is \(7+3+4+5+8+2+1=30\). Since \(30\equiv3\pmod9\), the original number also has remainder \(3\).
Check whether \(9182734\) is divisible by \(11\).
Compute the alternating sum of digits.
From the right, \(4-3+7-2+8-1+9=22\). Since \(22\) is divisible by \(11\), \(9182734\) is divisible by \(11\).
Find the last digit of \(3^{2026}\).
The last digits of powers of \(3\) have period \(4\).
The last digits are \(3,9,7,1\), then the cycle repeats. Since \(2026\equiv2\pmod4\), the last digit is \(9\).
Write \((341)_b\) as an expression in \(b\).
Each digit is multiplied by the corresponding power of the base.
We have \((341)_b=3b^2+4b+1\).
Represent \(1111\) in the form \(\frac{10^n-1}{9}\).
It is a number of four ones.
Since \(1111=1+10+10^2+10^3\), we have \(1111=\frac{10^4-1}{9}\).
Find all digits \(x\) for which \(52x47\) is divisible by \(9\).
The digit sum must be divisible by \(9\).
The digit sum is \(5+2+x+4+7=18+x\). This is divisible by \(9\) exactly for \(x=0\) or \(x=9\).
Find the digit \(x\) if \(63x915\) is divisible by \(11\).
Form the alternating sum from the right.
We get \(5-1+9-x+3-6=10-x\). We need \(10-x\equiv0\pmod{11}\). For a digit \(x\), this would require \(x=10\), impossible. Hence no such digit exists.
Find the last two digits of \(9^{37}\).
Look at the cycle of powers of \(9\) modulo \(100\).
We have \(9^1\equiv9\), \(9^2\equiv81\), \(9^3\equiv29\), \(9^4\equiv61\), \(9^5\equiv49\), and \(9^{10}\equiv1\pmod{100}\). Since \(37\equiv7\pmod{10}\), \(9^{37}\equiv9^7\equiv69\pmod{100}\). The last two digits are \(69\).
Find all bases \(b>4\) for which \((34)_b\) is divisible by \(5\).
Translate \((34)_b\) into \(3b+4\).
We need \(3b+4\equiv0\pmod5\), so \(3b\equiv1\pmod5\). The inverse of \(3\) modulo \(5\) is \(2\), hence \(b\equiv2\pmod5\). With \(b>4\), \(b=5t+2\), \(t\ge1\).
Find the period length of \(\frac{1}{13}\).
Find the least \(k\) such that \(10^k\equiv1\pmod{13}\).
We have \(10^2\equiv100\equiv9\pmod{13}\), \(10^3\equiv12\), \(10^4\equiv3\), \(10^5\equiv4\), \(10^6\equiv1\pmod{13}\). No smaller positive power gives \(1\), so the period is \(6\).
Prove that \(R_6=111111\) is divisible by \(37\).
Use \(10^3\equiv1\pmod{37}\).
Since \(10^3=1000\equiv1\pmod{37}\), we have \(10^6\equiv1\pmod{37}\). Hence \(37\mid 10^6-1\). The number \(9\) is coprime to \(37\), so from \(R_6=\frac{10^6-1}{9}\) it follows that \(37\mid R_6\).
Prove that the difference of two numbers formed from the same decimal digits is divisible by \(9\).
Such numbers have the same digit sum.
Each number is congruent to its digit sum modulo \(9\). The digit sums are equal, so the two numbers are congruent modulo \(9\). Therefore their difference is divisible by \(9\).
Prove that every decimal palindrome with an even number of digits is divisible by \(11\).
In the alternating sum, symmetric digits have opposite signs.
Because the number of digits is even, each pair of equal symmetric digits enters the alternating sum with opposite signs. Thus the alternating sum is \(0\), so the number is divisible by \(11\).
Find all \(n\ge1\) for which \(R_n\) is divisible by \(37\).
Since \(37\) is coprime to \(9\), the condition is equivalent to \(10^n\equiv1\pmod{37}\).
We have \(10^3=1000\equiv1\pmod{37}\), while \(10 ot\equiv1\) and \(10^2\equiv26 ot\equiv1\pmod{37}\). The order of \(10\) modulo \(37\) is \(3\). Hence \(37\mid R_n\) exactly when \(3\mid n\).
Prove that the number consisting of \(6n\) ones is divisible by \(7\), \(11\), and \(13\).
Use \(R_6\mid R_{6n}\).
Since \(6\mid6n\), we have \(R_6\mid R_{6n}\). But \(R_6=111111=111\cdot1001\), and \(1001=7\cdot11\cdot13\). Hence \(R_{6n}\) is divisible by \(7\), \(11\), and \(13\).
Find the last two digits of \(3^{2026}+7^{2026}\).
The powers of \(3\) and \(7\) modulo \(100\) have period \(20\).
Since \(3^{20}\equiv1\pmod{100}\) and \(7^{20}\equiv1\pmod{100}\), and \(2026\equiv6\pmod{20}\), we get \(3^{2026}\equiv3^6\equiv29\) and \(7^{2026}\equiv7^6\equiv49\pmod{100}\). Their sum is \(78\).
Find all bases \(b>5\) for which \((251)_b\) is divisible by \(13\).
Solve \(2b^2+5b+1\equiv0\pmod{13}\).
Checking residues \(b=0,1,\ldots,12\) gives \(b\equiv1\) or \(b\equiv3\pmod{13}\). With \(b>5\), the bases are \(b=13t+1\), \(t\ge1\), or \(b=13t+3\), \(t\ge1\).
Find the period length of \(\frac{1}{27}\).
Find the order of \(10\) modulo \(27\).
We have \(10^1\equiv10\), \(10^2\equiv100\equiv19\), \(10^3\equiv190\equiv1\pmod{27}\). Smaller positive powers do not give \(1\), so the period is \(3\).
Find all \(n\) for which \(31\mid R_n\).
Find the order of \(10\) modulo \(31\).
Since \(31\) is coprime to \(9\), the condition \(31\mid R_n\) is equivalent to \(10^n\equiv1\pmod{31}\). Computation gives \(10^5\equiv25\), \(10^{15}\equiv1\pmod{31}\), and the smaller divisors \(1,3,5\) of \(15\) do not give \(1\). Hence the order is \(15\), so \(31\mid R_n\) exactly when \(15\mid n\).
Let \(N\) be a four-digit number, and let \(M\) be obtained by reversing its digits. Prove that \(N-M\) is divisible by \(9\).
The numbers \(N\) and \(M\) have the same digit sum.
The numbers \(N\) and \(M\) have the same digit sum, hence they are congruent modulo \(9\). Therefore \(N-M\equiv0\pmod9\), so \(9\mid N-M\).
Let \(\gcd(m,10)=1\). Prove that there exists a number consisting only of digit \(1\) that is divisible by \(m\).
Consider \(R_1,\ldots,R_m\) and their residues modulo \(m\).
If one of \(R_1,\ldots,R_m\) is divisible by \(m\), we are done. Otherwise two residues coincide: \(R_i\equiv R_j\pmod m\), \(i
Is it true that for every positive integer \(m\), there exists a number written only with digit \(9\) that is divisible by \(m\)? Give the exact corrected statement.
Check what happens for \(m=2\) and \(m=5\).
A number made of nines is always odd and ends in \(9\), so it is not divisible by \(2\) or \(5\). Thus the original statement is false. The corrected statement is: if \(\gcd(m,10)=1\), then such a number exists. Indeed, by the previous construction there is \(R_n\) divisible by \(m\); then \(9R_n\) consists only of nines and is also divisible by \(m\).
Prove that if \(R_a\mid R_b\), then \(a\mid b\).
Prove that there exists a positive integer consisting only of digits \(0\) and \(1\) that is divisible by \(2026\).
First construct a number of ones divisible by \(1013\), then append a final digit \(0\).
We have \(2026=2\cdot1013\), and \(\gcd(1013,10)=1\). By the repunit construction, there exists \(R_n\) divisible by \(1013\). Then \(10R_n\) is obtained by appending a zero to a number of ones, so it consists only of digits \(0\) and \(1\). It is divisible by \(10\), hence by \(2\), and also by \(1013\). Therefore it is divisible by \(2026\).
Ladders