Prime numbers
Prime numbers show up constantly on the AMC. A prime number is a positive integer that has exactly two positive divisors: and itself. The only even prime is .
You’ll want to recognize any prime number below , and you should be able to list all primes below from memory. Try writing them out, then compare your list to the one below.
Why are prime numbers important?
In the real world, primes matter in cryptography, computer science, and even music. On the AMC, primes appear in many settings, especially problems involving:
- prime factorization
- GCD and LCM
- modular arithmetic
- relatively prime integers
Prime factorization
A common way to find a prime factorization is the factor tree method. The idea is simple:
- Split the number into two factors.
- Keep factoring any composite factors.
- Stop when every branch ends in a prime.
The prime factorization is the list of primes at the ends of the branches (including repeats). You don’t need to worry about picking “the right” factors at each step: no matter which factors you choose first, you’ll end with the same prime factorization.
As shown above, the prime factorization of is .
Example: The question below is from 2007 AMC 8
What is the sum of the two smallest prime factors of ?
A.
B.
C.
D.
E.
Answer: C.
Modular arithmetic and primes
Fermat’s Little Theorem is a useful tool in modular arithmetic. It says
- If is prime and is not divisible by , then raising to the power leaves a remainder of when divided by .
For example, take and . Since does not divide , Fermat’s Little Theorem applies, so (mod ).
,
=
=
remainder
Example: The question below is from 2017 AMC 10B
An integer is selected at random in the range . What is the probability that the remainder when is divided by is ?
A.
B.
C.
D.
E.
Answer: D.
Relatively prime integers
Two integers are relatively prime (or coprime) if they share no common prime factors. The numbers themselves do not have to be prime.
For example, and are relatively prime. Even though neither number is prime, they have no common divisor other than .
Example: The question below is from 2021 AMC 12A
Consider the set of all fractions, where and are relatively prime positive integers. How many of these fractions have the property that if both numerator and denominator are increased by , the value of the fraction is increased by ?
A.
B.
C.
D.
E.
Answer: B.