Study smarter with Fiveable
Get study guides, practice questions, and cheatsheets for all your subjects. Join 500,000+ students with a 96% pass rate.
Number theory forms the mathematical backbone of modern computing and cryptography. In discrete math, you're expected to understand divisibility relationships, modular systems, and the theorems that connect them. These concepts build on each other, from basic divisibility all the way up to the cryptographic applications that secure online transactions.
Don't just memorize definitions and formulas. For each concept, know why it works, how it connects to other ideas, and when you'd apply it. Can you explain why the Euclidean algorithm is efficient? Do you see how Euler's Theorem generalizes Fermat's Little Theorem? Master the underlying logic, and the individual facts will stick.
These concepts establish the ground rules for how integers relate to each other. Every theorem that follows depends on understanding what it means for one number to divide another.
Divisibility has a precise definition: divides (written ) if there exists an integer such that . For example, because .
The Division Algorithm guarantees that for any integers and (with ), there exist unique integers (quotient) and (remainder) such that:
For instance, dividing 17 by 5 gives , so and . The uniqueness of and is what makes this a theorem, not just long division.
The GCD of two integers is the largest positive integer that divides both of them. It's the foundation for simplifying fractions and solving equations.
The Euclidean Algorithm computes the GCD efficiently by repeatedly applying the division algorithm. The key identity is:
Here's how it works step by step for :
The algorithm terminates when the remainder hits 0. The last nonzero remainder is the GCD.
The Extended Euclidean Algorithm goes further: it finds integers and such that . This is critical for solving Diophantine equations and finding modular inverses.
The LCM of two integers is the smallest positive integer divisible by both. Think of it as solving synchronization problems: if one event repeats every 6 days and another every 8 days, they coincide every days.
The GCD and LCM are connected by this relationship:
This means if you know one, you can always compute the other.
Compare: GCD vs. LCM โ both measure divisibility relationships, but GCD finds the largest shared factor while LCM finds the smallest shared multiple. If a problem gives you one, you can compute the other using .
Primes are the atoms of number theory. Every integer greater than 1 is either prime or can be broken down into prime factors, and this decomposition is unique.
A prime number is a natural number greater than 1 whose only positive divisors are 1 and itself. The first several primes are 2, 3, 5, 7, 11, 13, ...
The Fundamental Theorem of Arithmetic states that every integer greater than 1 has a unique prime factorization, up to the ordering of factors. For example, and no other combination of primes will produce 360.
Prime factorization also gives you a way to compute GCD and LCM: take the minimum power of each shared prime for GCD, and the maximum power of every prime for LCM. For example, with and :
A linear Diophantine equation has the form , where are integers and you need integer solutions for and .
The existence criterion is clean: solutions exist if and only if divides . For example, has solutions because and . But has no integer solutions because .
Once you find one particular solution (using the Extended Euclidean Algorithm), the general solution generates infinitely many solutions parameterized by an integer .
Compare: Prime factorization vs. Euclidean algorithm for finding GCD โ factorization gives conceptual insight but is computationally expensive for large numbers. The Euclidean algorithm is efficient even for massive integers. Know when to use each approach.
Modular arithmetic transforms infinite integer problems into finite, cyclic systems. This is where number theory meets practical computation.
The core idea: work with remainders when dividing by a fixed modulus , reducing the infinite integers to a finite set .
The congruence notation means and have the same remainder when divided by . Equivalently, . For example, because .
Clock arithmetic is the classic example: 14:00 and 2:00 are the same on a 12-hour clock because .
Congruence modulo is an equivalence relation, meaning it's reflexive, symmetric, and transitive. This lets you manipulate congruences algebraically, much like equations.
Arithmetic works as expected for addition and multiplication. If , then:
Division is the exception. You can only divide (cancel) both sides by if . For example, is trivially true, but dividing both sides by 2 gives , which happens to work. However, is true (both leave remainder 4 mod 6), but dividing by 2 gives , which is false. The safe rule: only cancel when .
Compare: Modular addition/multiplication vs. modular division โ the first two always preserve congruence, but division requires the divisor to be coprime with the modulus. This distinction is crucial for solving congruence equations.
These theorems reveal deep structure in modular exponentiation. They're not just theoretical; they power modern cryptography.
Statement: If is prime and , then:
There's also a corollary form that drops the coprimality requirement: for any integer , . This version holds even when divides .
The main use in practice is reducing large exponents. For example, to compute : since 7 is prime and , you know . Then . And , so .
Euler's Theorem generalizes Fermat to any modulus: if , then:
The totient function counts the integers from 1 to that are coprime to . Key formulas:
These formulas combine to handle any integer via its prime factorization. For example, . The four integers from 1 to 12 coprime to 12 are: 1, 5, 7, 11.
Compare: Fermat's Little Theorem vs. Euler's Theorem โ Fermat works only for prime moduli, while Euler handles any modulus (with coprimality). When is prime, , so Euler's reduces exactly to Fermat's. Exam questions often ask you to identify which theorem applies.
When you need to solve multiple congruences simultaneously, the Chinese Remainder Theorem (CRT) provides the tool.
Statement: Given pairwise coprime moduli , the system of congruences
has a unique solution modulo .
The pairwise coprimality requirement is essential. If two moduli share a common factor, the system might have no solution or might not have a unique one modulo . For example, and has no solution because any number that's 1 mod 4 is odd, but any number that's 2 mod 6 is even.
CRT is powerful because it lets you break a hard problem into easier pieces. To compute something mod 105, you can work mod 3, mod 5, and mod 7 separately (since ), then reconstruct the answer. Computer algebra systems use this technique extensively.
Compare: Solving single congruences vs. systems via CRT โ single congruences use basic modular arithmetic or the Extended Euclidean Algorithm, while systems require CRT's decomposition approach. You should verify coprimality before applying CRT.
| Concept | Key Tools |
|---|---|
| Divisibility foundations | Division algorithm, GCD, LCM |
| Efficient computation | Euclidean algorithm, Extended Euclidean algorithm |
| Unique factorization | Fundamental Theorem of Arithmetic, prime factorization |
| Integer equations | Linear Diophantine equations, existence via GCD |
| Modular systems | Congruences, modular arithmetic properties |
| Prime modulus theorems | Fermat's Little Theorem |
| General modulus theorems | Euler's Theorem, totient function |
| Simultaneous congruences | Chinese Remainder Theorem |
What condition must be satisfied for the linear Diophantine equation to have integer solutions, and how does this connect to the Euclidean algorithm?
Compare Fermat's Little Theorem and Euler's Theorem: under what conditions does each apply, and how is Fermat's theorem a special case of Euler's?
If you need to find , which method would be more efficient: prime factorization or the Euclidean algorithm? Trace through the steps of your chosen method.
Why does the Chinese Remainder Theorem require the moduli to be pairwise coprime? What would go wrong if ?
Given that and , explain why you can conclude but cannot always conclude .