Modulo Calculator
Calculate the remainder of division (modulus operation). Essential for many geocaching puzzles.
Quick Reference
What is the Modulo Operation?
The modulo operation (often abbreviated as "mod") finds the remainder after division of one number by another. If you divide 17 by 5, you get 3 with a remainder of 2. That remainder (2) is what the modulo operation returns: 17 mod 5 = 2.
In programming and mathematics, modulo is represented by various symbols: %(most programming languages), mod (mathematical notation), or≡ (mod n) (congruence notation).
How Modulo Works
The modulo operation can be understood through the division algorithm:
A = B × Q + R
- A: The dividend (number being divided)
- B: The divisor (number dividing by)
- Q: The quotient (integer result of division)
- R: The remainder (the modulo result)
The remainder R is always: 0 ≤ R < |B|
Modulo in Geocaching Puzzles
Modulo arithmetic appears frequently in geocaching puzzles:
Cipher Wrapping
Ciphers like Caesar and Vigenère use mod 26 to wrap around the alphabet. If you shift 'Z' (position 26) by 1, you get 27 mod 26 = 1, which wraps back to 'A'.
Clock Arithmetic
Many puzzles use modular arithmetic similar to a clock. Using mod 12, 3 hours after 11 o'clock is (11 + 3) mod 12 = 2 o'clock.
Check Digits
Some coordinate puzzles use check digits based on modulo. ISBN numbers use mod 11, credit cards use mod 10 (Luhn algorithm), and UPC codes use mod 10.
Pattern Finding
When looking for patterns in number sequences, modulo can reveal hidden cycles:7, 14, 21, 28... all equal 0 (mod 7).
Common Modulo Values
| Modulo | Common Use |
|---|---|
| mod 2 | Even/odd check (0 = even, 1 = odd) |
| mod 10 | Last digit, check digits |
| mod 12 | Clock hours, months |
| mod 26 | Alphabet ciphers (A-Z) |
| mod 60 | Minutes/seconds |
| mod 360 | Compass bearings, angles |
Modulo Properties
- A mod A = 0 (any number mod itself is 0)
- A mod 1 = 0 (any number mod 1 is 0)
- A mod B = A if A < B (if smaller than divisor, unchanged)
- (A + B) mod N = ((A mod N) + (B mod N)) mod N
- (A × B) mod N = ((A mod N) × (B mod N)) mod N
Negative Numbers
Different programming languages handle negative numbers differently in modulo:
- -7 mod 3: Some languages return -1, others return 2
- Mathematical convention: The result has the same sign as the divisor
- Programming convention: Often has the same sign as the dividend
Our calculator uses the mathematical convention where the remainder is always non-negative when the divisor is positive.
Solving Modulo Equations
In puzzle caches, you might need to find a number that satisfies multiple modulo conditions:
- Find X where X mod 3 = 2 and X mod 5 = 1
- This is the Chinese Remainder Theorem problem
- Solution: X = 11 (and 11 + 15k for any integer k)
Related Mathematical Tools
- GCD/LCM Calculator: Find greatest common divisor and least common multiple, related to modular arithmetic.
- Number Base Converter: Convert between number bases, which uses repeated division and remainders.
- Prime Checker: Test if numbers are prime, important for advanced modular arithmetic.