Modulo Calculator
Calculate modulo operations and check number congruence with detailed explanations
🔢 Modulo Calculator
Calculate: 17 mod 5
The number being divided
The modulus (cannot be 0)
Formula
a = q × n + r
Where:
- a =Dividend (the number being divided)
- n =Divisor/Modulus
- q =Quotient (result of integer division)
- r =Remainder (0 ≤ r < |n|)
- a ≡ b (mod n) =a and b are congruent modulo n
About Modular Arithmetic
Modular arithmetic is a system of arithmetic for integers where numbers "wrap around" after reaching a certain value called the modulus.
Key Concepts:
- • Modulo Operation: a mod n gives the remainder when a is divided by n
- • Congruence: a ≡ b (mod n) means a and b have the same remainder
- • Euclidean Division: a = q × n + r, where 0 ≤ r < |n|
- • Clock Arithmetic: Time calculations use modulo 12 or 24
Applications:
- • Computer Science: Hash functions, array indexing
- • Cryptography: RSA encryption, digital signatures
- • Number Theory: Prime testing, factorization
- • Calendar Systems: Day of week calculations
- • Music Theory: Note intervals and octaves
Properties:
- • (a + b) mod n = ((a mod n) + (b mod n)) mod n
- • (a × b) mod n = ((a mod n) × (b mod n)) mod n
- • If a ≡ b (mod n), then a + c ≡ b + c (mod n)
- • If a ≡ b (mod n), then ac ≡ bc (mod n)
Common Uses:
- • Check if a number is even: n mod 2 = 0
- • Cycle through array indices: (i + 1) mod length
- • Convert 24-hour to 12-hour time: hour mod 12
- • Find last digit: number mod 10
Tips
- Enter the dimensions in the same unit for consistency.
- Results update automatically as you type.
- Use the unit selector to convert between different measurement systems.