Definition 17.1.1 · Primes
Primes are numbers that have exactly two factors: and the number itself.
Example: are all primes.
Note: is not a prime (it has only one factor), and is the only even prime.
Spot primes, test divisibility in your head, break numbers into primes, and count the zeros at the end of a factorial.
In this section you will be able to spot prime numbers and test whether a number is prime using only primes up to its square root.
Try to split 12 cookies into equal rows. You can make rows of 2, 3, 4 or 6. Now try 13 cookies. Only one long row works! Numbers like 13 are called primes.
A prime can’t be split into a product of smaller numbers. Every other number bigger than 1 can.
The sieve finds primes by crossing out multiples. Look: once you have swept every prime up to the square root of the biggest number, nothing new gets crossed out.
Primes are numbers that have exactly two factors: and the number itself.
Example: are all primes.
Note: is not a prime (it has only one factor), and is the only even prime.
It's highly recommended to memorize the first few primes, as this can save some time during the contest:
To check whether a number is prime, you only need to check whether it can be divided by the primes that are less than or equal to .
For example, , so you test . And , so is not prime.
Which of the following numbers has the smallest prime factor?
(A) 55 (B) 57 (C) 58 (D) 59 (E) 61
The sum of two prime numbers is 85. What is the product of these two prime numbers?
What is the smallest positive integer that is neither prime nor square and that has no prime factor less than 50?
Three members of the Euclid Middle School girls' softball team had the following conversation.
Ashley: I just realized that our uniform numbers are all 2-digit primes.
Brittany: And the sum of your two uniform numbers is the date of my birthday earlier this month.
Caitlin: That's funny. The sum of your two uniform numbers is the date of my birthday later this month.
Ashley: And the sum of your two uniform numbers is today's date.
What number does Caitlin wear?
In this section you will be able to decide whether a number is divisible by 2 through 12 or 15 without doing the long division.
Is 4,827,676 divisible by 8? You could do a long division. Or you could look at just three digits and know in a few seconds.
Each rule only looks at part of the number: the last digit, the last few digits, or the digit sum. The rest of the number is a multiple of 10, 100 or 1000 and never changes the answer.
For 6, 12 and 15, check two simpler rules. A number divisible by 3 and by 4 is divisible by 12.
| Divisor | Rule |
|---|---|
| 2 | Last digit is even |
| 3 | Sum of digits is divisible by 3 |
| 4 | Last 2 digits divisible by 4 |
| 5 | Last digit is 0 or 5 |
| 6 | Divisible by 2 and 3 |
| 7 | Take out multiples of 7 until you reach a small number that is either divisible or not divisible by 7 |
| 8 | Last 3 digits are divisible by 8 |
| 9 | Sum of digits is divisible by 9 |
| 10 | Last digit is 0 |
| 11 | Add the digits in odd positions () and in even positions (). If is divisible by 11, so is the number |
| 12 | Divisible by 3 and 4 |
| 15 | Divisible by 3 and 5 |
In general, if a number is divisible by 2 different primes or prime powers (numbers that are powers of a prime, like or ), then it is also divisible by their product.
For example, to find whether a number is divisible by , you just check whether it's divisible by each of , and using the divisibility rules.
How many three-digit numbers are divisible by 13?
The number 64 has the property that it is divisible by its units digit. How many whole numbers between 10 and 50 have this property?
The 5-digit number is divisible by 9. What is the remainder when this number is divided by 8?
The 7-digit numbers 74A52B1 and 326AB4C are each multiples of 3. Which of the following could be the value of C?
(A) 1 (B) 2 (C) 3 (D) 5 (E) 8
The digits 1, 2, 3, 4, and 5 are each used once to write a five-digit number PQRST. The three-digit number PQR is divisible by 4, the three-digit number QRS is divisible by 5, and the three-digit number RST is divisible by 3. What is P?
Call a positive integer an uphill integer if every digit is strictly greater than the previous digit. For example, 1357, 89, and 5 are all uphill integers, but 32, 1240, and 466 are not. How many uphill integers are divisible by 15?
Ayasha, Beshkno, and Chenoa were all born after 2000. Each of them was born in a year after 2000 that is divisible by exactly one of the prime numbers 2, 3 or 5. Each of these primes is a divisor of one of the birth years. What is the least possible sum of their birth years?
In this section you will be able to write any number as a product of primes, and use that to break hard divisibility problems into easy rules.
Every number is built from primes, like a house from bricks. 60 is 2 × 2 × 3 × 5, and no other set of primes makes 60.
A prime factorization writes a number as a product of primes, like . However you split, you end with the same primes.
To test divisibility by a big number like 264, factor it first: . Then use the rules for 8, 3 and 11.
In these types of problems, it's almost always best to first find the prime factorization of the number, and then use the divisibility rules for each of the primes or prime powers in the prime factorization.
Find the prime factorization of 117.
Is 117 divisible by 2?
Let be a 6-digit positive integer, such as 247247, whose first three digits are the same as its last three digits taken in the same order. Which of the following numbers must also be a factor of ?
(A) 11 (B) 19 (C) 101 (D) 111 (E) 1111
Split into . What is ?
What four-digit number has tens digit 2 and units digit 8, is a multiple of 16, and when its digits are reversed the result is also a multiple of 16?
Call the number . Every multiple of 16 is a multiple of 8. What does the rule for 8 say about the last three digits ?
A number is called flippy if its digits alternate between two distinct digits. For example, 2020 and 37373 are flippy, but 3883 and 123123 are not. How many five-digit flippy numbers are divisible by 15?
Divisible by 15 means divisible by which two numbers?
The 3 digit number A3B is divisible by 15. What is the sum of all such possible numbers?
For a number to be divisible by 15, what other numbers must it be divisible by?
The number 3AB76 is divisible by 264, where A and B are digits. Find A + B.
For a number to be divisible by 264, what other numbers must it be divisible by?
What is the sum of the two smallest prime factors of 250?
What is the prime factorization of 420?
What is the prime factorization of 1001?
If , , and , what is the product of , , and ?
The number AB962C is divisible by 792 where A, B, C are digits. What is the value of A?
The number 8173ABC is divisible by 165. What is the average of all such 3 digit numbers ABC that satisfy this condition?
Sohil is thinking of a 5 digit number such that the first 3 digits are divisible by 63, the middle 3 digits are divisible by 8, and the last 3 digits are divisible by 11. What is the largest possible number he can be thinking of?
In this section you will be able to count how many times a prime divides n!, and how many zeros n! ends with.
10! = 3,628,800 ends in two zeros. How many zeros does 100! end with? It has 158 digits, so you’ll want a shortcut!
Each multiple of gives one factor of . Multiples of hide a second one, multiples of a third. Count them layer by layer.
The number of factors of a prime in is
Here means "round down to a whole number".
This formula seems complicated, but it is much easier to apply than it may seem. It basically means
number of factors of in = the number of multiples of that are + the number of multiples of that are +
Each multiple of gives one factor of . A multiple of has a second factor of hiding inside it, so it gets counted again in the second term, and so on.
Find the number of 0's at the end of 100!.
Each 0 at the end comes from a factor of . Which factor is rarer in , 2 or 5?
For any positive integer , the notation denotes the product of the integers 1 through . What is the largest integer for which is a factor of the sum ?
The base-ten representation for is , where , , and denote digits that are not given. What is ?
In this section you will be able to mix primes, divisibility rules and factorizations on contest problems.
One last puzzle that uses the rules for 2, 3, 4, 5 and 6 all at once. Every problem has three hints if you get stuck.
Want every problem from this chapter on one page? Open the problem set.
How many permutations of 123456 are divisible by their last digit? For instance, 123456 is divisible by 6, but 561234 is not divisible by 4.