Number Theory Basics
Competition Math · AMC 8 LevelPreview
1. Introduction
Number theory is the study of the integers, and on the AMC 8 it shows up constantly: counting divisors, finding the greatest common divisor of two numbers, deciding whether a big number is divisible by , or hunting for the smallest integer with a special property. Almost every one of these problems becomes easy once you can do one thing well — break a number into its prime factorization.
The reason primes matter so much is that they are the atoms of multiplication. Every whole number bigger than is either prime itself or can be built by multiplying primes together, and there is essentially only one way to do it. Once you see a number like as , questions like "how many divisors does it have?" or "what is its GCD with ?" turn into quick exponent bookkeeping instead of guesswork.
In this article you will learn the divisibility rules and why they work, the Fundamental Theorem of Arithmetic, how to count divisors and sum them, how to compute the GCD and LCM both by factoring and by the lightning-fast Euclidean algorithm, modular thinking for digit puzzles, and how all of these combine in real contest problems. Master this material and a large slice of the AMC 8 number-theory questions become routine.
2. Core Concepts
Concept 1 — Divisibility and Factors
We say an integer divides , written , if for some integer — that is, divided by leaves no remainder. Then is a divisor (or factor) of , and is a multiple of . For example because , but .
Every positive integer has at least two divisors, and itself. A prime is an integer greater than whose only divisors are and itself: . A composite is an integer greater than that is not prime. The number is special: it is neither prime nor composite.
Concept 2 — The Fundamental Theorem of Arithmetic
Fundamental Theorem of Arithmetic. Every integer can be written as a product of primes, and this factorization is unique up to the order of the factors. We collect repeated primes into powers: where the are distinct primes and each exponent . For instance and .
This uniqueness is the engine behind nearly every technique below. To factor a number by hand, repeatedly divide out the smallest prime that fits: , recording .
Concept 3 — Why Divisibility Rules Work
Divisibility rules come from the place-value structure of base ten. Since and , every power of leaves remainder , so a number is congruent to its digit sum modulo and modulo . Since , powers of alternate , which is why the alternating digit sum controls divisibility by . And because is a multiple of (and a multiple of ), only the last two digits matter for and the last three for .
Concept 4 — Divisibility by 2, 5, and 10
A number is divisible by when its last digit is even (). It is divisible by when its last digit is or . It is divisible by when its last digit is . These follow because and for every , so only the units digit of matters for divisibility by or .
Concept 5 — Divisibility by 3 and 9
Theorem (digit-sum test). An integer is divisible by (resp. ) if and only if the sum of its decimal digits is divisible by (resp. ).
Example: has digit sum . Since , the number is not divisible by . For , note , so it is not divisible by either.
Concept 6 — Divisibility by 4, 8, and 11
- By : check whether the number formed by the last two digits is a multiple of . Example: ends in , and , so .
- By : check the last three digits. Example: ends in , so .
- By : form the alternating sum of digits from the right: . The number is divisible by iff this alternating sum is divisible by . Example: gives , not divisible by .
Concept 7 — GCD and LCM
The greatest common divisor is the largest integer dividing both and . The least common multiple is the smallest positive integer that both and divide. Two integers with are called relatively prime or coprime.
In terms of prime factorizations, the GCD takes the minimum exponent of each shared prime and the LCM takes the maximum exponent of every prime that appears in either number.
Concept 8 — The GCD–LCM Identity
Theorem. For any positive integers and , Knowing any three of these four quantities gives the fourth instantly. This identity is one of the fastest sanity checks on contest problems.
Concept 9 — The Euclidean Algorithm
When numbers are large or awkward to factor, use the Euclidean algorithm: , repeating until the remainder is . The last nonzero remainder is the GCD. This algorithm is guaranteed to terminate and is far faster than factoring for large integers.
Concept 10 — Counting Divisors
If , each divisor is built by choosing an exponent from to for each prime . Hence the divisor-count formula: A perfect square is exactly the positive integer whose divisor count is odd, because one exponent can be chosen in only one way to pair with itself (the middle exponent when all exponents are even).
Concept 11 — Sum of Divisors
The sum-of-divisors function adds every positive divisor of . From the prime factorization, This appears when a problem asks for "the sum of all factors" or "the sum of proper divisors."
Concept 12 — Trailing Zeros and Prime Powers in Factorials
The number of trailing zeros in equals the number of factors of in , because factors of are always more plentiful: More generally, the exponent of a prime in is .
Continue reading with Premium
Upgrade to read the full article and unlock all Premium features.
Free
- Unlimited practice — all difficulties
- 3 hints / day
- Community solutions
- 2 timed mocks / month
Premium
- ✓Full article + all 57+ theory guides
- ✓Unlimited hints on practice problems
- ✓Unlimited timed mock exams & PDF worksheets