The Daily Reckoning
How Can 7²²² Fit on a Clock?
Modular arithmetic discards whole laps, turning a 188-digit power into a four-step cycle.
Arithmetic Behind Secure Messages · Part 1 of 3
- Difficulty
- Foundational
- Area
- Numbers and algebra
- Reading time
- 9 minutes
- Prerequisites
- Whole-number division with remainders · Exponents · Factors and multiples
The number has 188 decimal digits. Writing all of them would answer many questions nobody asked. Suppose we want only the final digit.
A final digit is a remainder after division by . The numbers , , and all leave remainder when divided by , so they are interchangeable for this particular question. Modular arithmetic turns that deliberate loss of information into a system of calculation.
The answer to our enormous-looking problem is . We can reach it without ever handling a number larger than .
When numbers differ by a whole number of laps
Imagine ten marked positions arranged in a circle: . Moving forward positions ends at because the first moves complete a lap. Moving forward positions ends there too. Modular arithmetic forgets the completed laps and remembers the landing position.
Here is the precise definition. Let and be integers, and let be a positive integer. We write
and say “ is congruent to modulo ” when divides . The statement “ divides ” means that equals times some integer. Equivalently, and leave the same remainder when divided by .
For example,
because , and is divisible by . Congruence is not equality: and are different integers. They occupy the same position on a ten-position remainder clock.
The interactive diagram below uses modulus , so each highlighted position is a possible final digit. Choose a base, then move the exponent slider. The glowing path records each remainder produced by another multiplication.
Interactive remainder clock
Watch powers wrap around ten possible endings
- Current remainder
- 9
- Repeating cycle
- 1 → 7 → 9 → 3
Powers visited
- 701
- 717
- 729
- 733
- 741
- 757
- 769
Why throwing information away is safe
Replacing by would ruin a calculation that needs the full value. It preserves any calculation that asks only for a remainder modulo .
More generally, suppose
where and are integers and is a positive integer. We may add or multiply the shorter representatives:
and
The addition rule works because
Both differences on the right are multiples of , so their sum is a multiple of . For multiplication,
Again, each term on the right contains a multiple of . This permission to reduce after every step prevents powers from becoming unmanageable.
Worked example: the last digit of
Start multiplying by , keeping only each remainder modulo :
The fourth power returns to remainder . Multiplying by once more must return to remainder , then to , then to , then to . The four-position cycle repeats because the next landing position depends only on the current remainder.
Now divide the exponent by the cycle length :
The exponent contains complete four-step cycles and two additional steps. Algebra says the same thing:
Therefore the final digit of is . The other 187 digits never enter the calculation.
Try two clocks
Problem 1
One hundred days after a Wednesday, what day of the week will it be? Treat Wednesday as the starting day rather than day one.
Reveal the solution
Days of the week repeat modulo . Divide by :
so
Move two weekdays forward from Wednesday: Thursday is one step and Friday is two. The date will fall on Friday.
Problem 2
Find the final two digits of . A pair such as counts as two digits.
Reveal the solution
Final two digits are determined by the remainder modulo . Repeated squaring keeps every intermediate value small:
Square that remainder to reach the tenth power:
Square once more:
The remainder is , so the final two digits are 01.
Remainders before the symbol
People calculated with remainders long before anyone wrote the congruence symbol. A Chinese mathematical text known as the Sunzi Suanjing asks for an unknown number of objects that leaves when counted by threes, when counted by fives, and when counted by sevens. The smallest answer is . The text gives a working method for such problems, the earliest surviving example of what Europeans later named the Chinese remainder theorem.
The author and date of the Sunzi Suanjing are not securely known. Historians place its composition or compilation roughly between the third and fifth centuries CE, and surviving editions may contain layers from different periods. That uncertainty matters: “Sunzi” does not identify a documented lone discoverer in the modern biographical sense. Shen Kangsheng’s historical study of the Chinese remainder theorem connects congruence problems in ancient China to calendar calculation, where several astronomical cycles had to be reconciled.
Indian mathematician and astronomer Aryabhata developed another remainder-based procedure called the kuṭṭaka, or “pulverizer.” His Aryabhatiya, completed in 499, used the procedure to solve integer equations arising from planetary periods. Aryabhata worked at Kusumapura when the city was a capital of the Gupta Empire and a center in a communications network through which mathematical and astronomical work circulated across India and later into the Islamic world. The University of St Andrews biography of Aryabhata documents both the astronomical motivation and that institutional setting.
Carl Friedrich Gauss supplied the notation used today. His 1801 Disquisitiones Arithmeticae begins by defining congruent numbers and introduces to emphasize an analogy with equality. Gauss did not invent division with remainders. He gathered results by earlier mathematicians, added major results of his own, and made congruence the organizing language of a systematic number theory.
That reorganization depended partly on patronage. A stipend from the Duke of Brunswick-Wolfenbüttel allowed Gauss to attend the Collegium Carolinum and later to pursue research without taking a job; the duke continued the support while Gauss prepared his doctorate and book. The MacTutor account of Gauss’s education makes the material condition unusually visible: the mathematics that now feels elementary reached print because a talented young scholar had sustained institutional funding.
What a remainder can carry
Schedules. Weekdays use modulus ; a 24-hour clock uses modulus . Gear teeth, rotating encoders, repeating shifts, and circular buffers share the same structure. A remainder records position inside a cycle while discarding completed cycles.
Error detection. An International Standard Book Number with ten characters, known as an ISBN-10, chooses its final character so a weighted sum is divisible by . For the valid ISBN ---,
and . Changing any one digit changes the remainder, so the check fails. The check character can be , representing , because modulus has eleven possible residues.
Public-key cryptography. Modern cryptographic standards repeatedly raise large integers to powers and reduce the results modulo another large integer. The Internet Engineering Task Force’s RSA specification, RFC 8017, for example, defines its core encryption operation by , where represents a message, is a public exponent, is a public modulus, and is the encrypted representative. Modular arithmetic alone does not make RSA secure; the choice of , the relation between public and private exponents, padding, and implementation details all matter. The next two lessons in this mini-series will build those missing pieces.
One idea to remember
Modular arithmetic keeps the landing position and discards whole laps. Once returns to modulo , every four additional factors of repeat the same final-digit pattern. For , only the remainder of after division by matters.
For another appearance of remainder arithmetic, revisit Euler’s bridge test: classifying a vertex degree as odd or even means recording that degree modulo . Part two of Arithmetic Behind Secure Messages will explain why prime moduli force useful power cycles.
Sources
- Sunzi Suanjing, remainder problem summarized in the University of St Andrews MacTutor biography of Sun Zi.
- Shen Kangsheng, “Historical Development of the Chinese Remainder Theorem”, Archive for History of Exact Sciences 38, no. 4, 1988, pp. 285–305; author manuscript hosted by Harvard Mathematics.
- University of St Andrews MacTutor, “Aryabhata the Elder”.
- Carl Friedrich Gauss, Disquisitiones Arithmeticae, Leipzig, 1801; digitized by Smithsonian Libraries.
- University of St Andrews MacTutor, “Johann Carl Friedrich Gauss”.
- University of New Brunswick, “Secrets of the ISBN: An Error Detection Method”, explaining the ISBN-10 weighted sum and modulus check.
- Kathleen Moriarty et al., RFC 8017: PKCS #1: RSA Cryptography Specifications Version 2.2, Internet Engineering Task Force, November 2016.