Testing Primes and Prime Factorisation
Is it prime? To test a number , divide it by each prime up to . If none of them divides it, is prime. You never need to go past the square root: if , one of and has to be at most .
For 389: and , so you only need to check the primes up to 19, which are 2, 3, 5, 7, 11, 13, 17 and 19. None of them divides 389, so 389 is prime.
Numbers that look prime but are not. These keep turning up in options, so it pays to know them on sight:
| Number | Factors | Number | Factors |
|---|---|---|---|
| 143 | 11 × 13 | 253 | 11 × 23 |
| 161 | 7 × 23 | 289 | 17 × 17 |
| 187 | 11 × 17 | 299 | 13 × 23 |
| 209 | 11 × 19 | 323 | 17 × 19 |
| 247 | 13 × 19 | 391 | 17 × 23 |
Prime factorisation by the division ladder. Divide by the smallest prime that goes in, write down what is left, and repeat until you reach 1.
| Divide by | What is left |
|---|---|
| 2 | 2520 ÷ 2 = 1260 |
| 2 | 1260 ÷ 2 = 630 |
| 2 | 630 ÷ 2 = 315 |
| 3 | 315 ÷ 3 = 105 |
| 3 | 105 ÷ 3 = 35 |
| 5 | 35 ÷ 5 = 7 |
| 7 | 7 ÷ 7 = 1 |
Collect the primes as powers: . Every formula in this section starts from this form, so get it right first. Multiplying back (8 × 9 × 5 × 7 = 2520) takes five seconds and catches most slips.
Co-prime factor pairs. A factor pair of is two numbers that multiply to give . In a co-prime pair the two numbers have HCF 1, so each prime power has to go whole to one side. If has different prime factors, it can be written as a product of two co-prime factors in ways.
2520 has four different primes (2, 3, 5 and 7), so there are co-prime pairs: 1 × 2520, 8 × 315, 9 × 280, 5 × 504, 7 × 360, 35 × 72, 40 × 63 and 45 × 56.
[SSC Tip] "Prime factors" and "factors" are different questions. 2520 has 48 factors, but only 4 different prime factors, and 7 prime factors if you count repeats (2, 2, 2, 3, 3, 5, 7). Read which one is asked.
Number, Sum and Product of Factors
Write the number in prime-power form, , where , and are different primes.
Number of factors
A factor can take to any power from 0 up to , which is choices, and the same for each other prime. For that gives 4 × 3 × 2 × 2 = 48 factors.
Sum of factors
For : (1 + 2 + 4 + 8)(1 + 3 + 9) = 15 × 13 = 195. Each bracket can also be written as , which is quicker for big powers: .
[Tier 2] Product of all factors. If has factors, they pair up as and , and each pair multiplies to . So the product of all the factors is . For 12, the factors are 1, 2, 3, 4, 6 and 12, so and the product is . Multiplying them out gives the same 1728.
Ways to write N as a product of two factors.
- If is not a perfect square, the factors pair up exactly, so there are ways. 72 has 12 factors, so 6 ways: 1 × 72, 2 × 36, 3 × 24, 4 × 18, 6 × 12 and 8 × 9.
- If is a perfect square, is a pair on its own, so there are ways. 36 has 9 factors, so 5 ways, counting 6 × 6.
Odd number of factors. Only perfect squares have an odd number of factors, because only they have a factor that pairs with itself. A number with exactly 3 factors must be the square of a prime: 4, 9, 25, 49, 121, …
[SSC Tip] The count includes 1 and the number itself. If the question says "factors other than 1 and the number", subtract 2. If it says "proper factors" or "proper divisors", it usually means every factor except the number itself, so subtract 1.
Odd, Even and Square Factors
Write the number as (its odd part). For , the odd part is .
Odd factors use no 2 at all. So drop the power of 2 and count the factors of the odd part. 360 has (2 + 1)(1 + 1) = 6 odd factors: 1, 3, 5, 9, 15 and 45.
Even factors = total factors − odd factors. 360 has 4 × 3 × 2 = 24 factors, so 24 − 6 = 18 are even. Another way to see it: an even factor must use at least one 2, so the power of 2 has choices (1 to ) instead of , giving 3 × 3 × 2 = 18.
Sum of odd factors: use the sum formula without the bracket for 2. For 360: (1 + 3 + 9)(1 + 5) = 13 × 6 = 78.
Sum of even factors = total sum − odd sum. The total for 360 is (1 + 2 + 4 + 8)(1 + 3 + 9)(1 + 5) = 15 × 13 × 6 = 1170, so the even factors add up to 1170 − 78 = 1092. Directly, it is (2 + 4 + 8)(1 + 3 + 9)(1 + 5) = 14 × 13 × 6 = 1092.
Square factors. A square factor has an even power of every prime. For a prime with power , the allowed powers are 0, 2, 4, … up to , which is (half of , rounded down) + 1 choices.
For : the 2 can be or (2 choices), the 3 can be or (2 choices), and the 5 can only be (1 choice). So 360 has 2 × 2 × 1 = 4 square factors: 1, 4, 9 and 36.
Sum of square divisors. Put only the even powers in each bracket. , so its square divisors add up to = 5 × 122 = 610. They are 1, 4, 121 and 484.
Factors of the form . These are even but not multiples of 4, so they contain exactly one 2. Their number equals the number of odd factors (as long as is even). 360 has 6 of them: 2, 6, 10, 18, 30 and 90.
Highest Power of a Prime in a Product or a Factorial
In a product. Factorise each number, count the prime in each one, and add. To find the largest such that divides 42 × 25 × 54 × 135:
- 42 = 2 × 3 × 7, one 3
- 25 = , no 3
- 54 = , three 3s
- 135 = , three 3s
The total is 1 + 0 + 3 + 3 = 7, so .
In a factorial. . To count how many times a prime goes into , divide by , by , by and so on, keep only the whole-number part of each answer, and add them up:
In practice you just keep dividing the last quotient by . Highest power of 2 in 60!: 60 ÷ 2 = 30, 30 ÷ 2 = 15, 15 ÷ 2 = 7, 7 ÷ 2 = 3, 3 ÷ 2 = 1. Total 30 + 15 + 7 + 3 + 1 = 56. Highest power of 3 in 60!: 20 + 6 + 2 = 28.
Why it works: 60 ÷ 2 counts one 2 from every even number. 60 ÷ 4 adds a second 2 for every multiple of 4, 60 ÷ 8 adds a third 2 for every multiple of 8, and so on.
[Tier 2] Composite numbers such as 12 or 10. Break the composite into prime powers, find each prime's power in , and see which one runs out first.
- 12 = . 60! has 56 twos, enough for 28 lots of , and 28 threes. Both allow 28, so the highest power of 12 in 60! is 28.
- 10 = 2 × 5. A factorial always has more 2s than 5s, so the highest power of 10 in is just the power of 5. In 60! that is 12 + 2 = 14.
The biggest prime is usually the one that runs out, but not always. With or in the composite, each copy uses several 2s. In 27! there are 23 twos (only 11 lots of ) and 13 threes, so the highest power of 12 in 27! is 11, and this time the 2s decide it. Work out both and take the smaller.
[SSC Tip] These questions ask for the exponent, not the number. If the options show 7 and , check which form the question wants.
Zeros at the End of a Product or a Factorial
Each zero at the end of a number comes from a factor of 10 = 2 × 5. So count the 2s and the 5s in the product. The number of zeros is the smaller of the two counts.
A product. For 25 × 32 × 45 × 60:
- 2s: 32 = gives 5 and 60 = gives 2, so 7 in all.
- 5s: 25 gives 2, 45 gives 1 and 60 gives 1, so 4 in all.
The smaller count is 4, so the product ends in 4 zeros. (It is 21,60,000.)
A factorial. always has more 2s than 5s, so the number of zeros at the end of is the power of 5 in it:
100! ends in 20 + 4 = 24 zeros, and 1000! ends in 200 + 40 + 8 + 1 = 249 zeros.
Traps to watch for.
- 25 = 5 × 5 gives two 5s, and 125 gives three. Forgetting the extra 5s is the usual mistake.
- When a product has few even numbers, the 2s can run out first. In 15 × 25 × 35 × 8 there are 4 fives but only 3 twos, so the product (1,05,000) ends in 3 zeros, not 4.
- A product of odd numbers only, like 1 × 3 × 5 × … × 99, has no 2 at all, so it ends in 5, not in 0.
- The product of the first 50 even numbers is 2 × 4 × … × 100 = . The 2s are plentiful, so the zeros come from the 5s in 50!: 10 + 2 = 12.
"Zeros at the end" and "highest power of 10" are the same question. Both mean counting the pairs of 2 and 5.
Perfect Squares: Quick Tests and Counting
A perfect square is a whole number multiplied by itself: 1, 4, 9, 16, 25, … The tests below can only prove that a number is not a square. A number that passes all of them still has to be checked.
Test 1: last digit. A square ends only in 0, 1, 4, 5, 6 or 9. Anything ending in 2, 3, 7 or 8 is not a square.
Test 2: zeros at the end. A square ends in an even number of zeros. 4900 (two zeros) can be a square; 49,000 (three zeros) cannot.
Test 3: digital root. Keep adding the digits until one digit is left. For a square this is always 1, 4, 7 or 9. So a digital root of 2, 3, 5, 6 or 8 rules a number out. 4,21,356 ends in 6, which is allowed, but its digits add up to 21 and 2 + 1 = 3, so it is not a square.
Test 4: the last two digits. A square ending in 5 always ends in 25. An even square is a multiple of 4, so its last two digits must be divisible by 4. A square ending in 6 has an odd tens digit (16, 36, 196, 256), while a square ending in 1, 4 or 9 has an even tens digit (81, 64, 49, 121).
Unit digit of a square. It depends only on the unit digit of the number.
| Number ends in | 0 | 1 or 9 | 2 or 8 | 3 or 7 | 4 or 6 | 5 |
|---|---|---|---|---|---|---|
| Square ends in | 0 | 1 | 4 | 9 | 6 | 5 |
So a square ending in 9 comes only from a number ending in 3 or 7. How many two-digit numbers have squares ending in 9? The two-digit numbers ending in 3 or 7 are 13, 17, 23, 27, …, 93, 97, two in each ten from the 10s to the 90s. That is 9 × 2 = 18.
How many perfect squares lie between two numbers? Find the smallest and largest whole numbers whose squares are inside the range, then count them. Between 500 and 2000: is too small, so the first is ; is too big, so the last is . There are 44 − 23 + 1 = 22 squares.
In "which of these is not a perfect square" questions, run the last-digit test across all four options first, then the digital root. One of them usually settles it in seconds.
Making a Number a Perfect Square
Least number to subtract or add. Find the squares on either side of the number. For 3000: and . The least number to subtract is 3000 − 2916 = 84, and the least number to add is 3025 − 3000 = 25. To find the right root quickly, start from round squares (, ) and narrow down.
Least multiplier or divisor. In a perfect square every prime has an even power. Factorise the number and look for the primes with odd powers.
- . Only the 5 has an odd power. Multiply by 5 to get 900 = , or divide by 5 to get 36 = .
- . Multiply by 2 to get 4900 = , or divide by 2 to get 1225 = .
Least perfect square divisible by given numbers. Take the LCM, factorise it, and multiply by whatever completes the pairs. For 6, 8 and 15 the LCM is . To make every power even, multiply by 2 × 3 × 5 = 30. So the answer is 120 × 30 = 3600 = . (LCM is covered in Section 5.)
Largest and smallest n-digit perfect squares.
- Largest: take the square root of the largest n-digit number, round down, and square. is just under 100, so the largest four-digit square is . In the same way the largest six-digit square is .
- Smallest: take the square root of the smallest n-digit number, round up, and square. has only three digits, so the smallest four-digit square is . For five digits, exactly, so 10,000 itself is the smallest. For six digits, is about 316.2, so the least six-digit perfect square is = 1,00,489.
The pattern for the smallest one changes with the number of digits. With an odd number of digits (like 10,000) the smallest n-digit number is itself a square. With an even number of digits (like 1,00,000) it is not, and you need the next square up.
[SSC Tip] Squares of numbers ending in 5 are quick to work out: for , write and put 25 after it. So = 7225 (8 × 9 = 72, then 25) and = 99,225 (31 × 32 = 992, then 25). This is handy for the bracketing step in the next part.
Square Roots by Unit Digit, and Arranging in a Square
Square root of a perfect square in three steps.
- Last digit. Use the unit-digit table to get two choices for the last digit of the root.
- Bracket the front part. Drop the last two digits and find the two squares that the rest sits between. That gives the first part of the root.
- Decide between the two choices by comparing with the square of the number ending in 5 in between.
For 73441:
- It ends in 1, so the root ends in 1 or 9.
- Dropping 41 leaves 734. and , so the root lies between 270 and 280. It is 271 or 279.
- = 75,625 (27 × 28 = 756, then 25), which is bigger than 73,441. So the root is below 275, and it is 271.
For the five- and six-digit squares that SSC uses, this is much faster than long division.
Arranging things in a square. When soldiers, trees or students are placed with as many rows as columns, the number used is a perfect square.
- "Left over" means the number minus the largest square that fits.
- "How many more are needed" means the next square minus the number.
For 4000 plants: , so a 63 × 63 square uses 3969 plants and 31 are left over. To make a 64 × 64 square you need − 4000 = 4096 − 4000 = 96 more.
The two-sided version. "A general arranges his soldiers in a square and finds 20 left over. With one more row and one more column he would be 41 short. How many soldiers are there?" Let the side be . Then . Since , this gives , so . There are + 20 = 920 soldiers.
The gap between two consecutive squares is the sum of the two numbers: . So . This is the quickest way through the two-sided arrangement questions.
Square Identities, and Perfect Cubes
Four consecutive numbers plus 1.
So the product of four consecutive numbers plus 1 is always a perfect square. For : 4 × 5 × 6 × 7 + 1 = 841 = , and .
Why it works: and . If , these two are and , and .
Difference of two squares. . If and are positive integers and the difference is a prime , the only split is and . So gives and .
For a composite difference, try every factor pair (small × large) in which both factors are odd or both are even, so that and come out whole. For , the pairs 1 × 45, 3 × 15 and 5 × 9 give = (23, 22), (9, 6) and (7, 2). That is three solutions.
A number that leaves remainder 2 when divided by 4 (such as 6, 10 or 14) can never be written as , because its factor pairs always have one odd and one even factor.
Perfect cubes, briefly. In a perfect cube every prime has a power that is a multiple of 3. To find the smallest multiplier, raise each power up to the next multiple of 3.
- . The 2 needs , so multiply by : 3456 × 4 = 13,824 = .
- To divide instead, bring the power down: divide by 2 to get 1728 = .
The unit digit of a cube: 0, 1, 4, 5, 6 and 9 stay the same, while 2 and 8 swap and 3 and 7 swap (, , , ). So the cube root of 3375 ends in 5, and since and it must be 15.
For a cube root, the unit digit plus the bracket from the front part (drop the last three digits) settles a perfect cube of up to six digits in one go.
Solved Examples
Question 1
Is 437 a prime number?
Answer. and , so is a little under 21, and I check the primes up to 19. 437 is odd, its digit sum is 14 so 3 is out, and it doesn't end in 0 or 5. For 7: 7 × 62 = 434, remainder 3. For 11: 7 − 3 + 4 = 8, no. For 13: 13 × 33 = 429, remainder 8. For 17: 17 × 25 = 425, remainder 12. For 19: 19 × 23 = 437 exactly. So 437 = 19 × 23, and it is not prime.
Question 2
Write 7560 as a product of primes and find how many factors it has.
Answer. I divide step by step. 7560 → 3780 → 1890 → 945 uses three 2s. Then 945 → 315 → 105 → 35 uses three 3s. Then 35 → 7 uses a 5, and 7 → 1 uses a 7. So .
Number of factors = (3 + 1)(3 + 1)(1 + 1)(1 + 1) = 4 × 4 × 2 × 2 = 64.
Question 3
Find the sum of all the factors of 540.
Answer. . I make one bracket for each prime: (1 + 2 + 4)(1 + 3 + 9 + 27)(1 + 5) = 7 × 40 × 6 = 1680.
Question 4
How many odd factors and how many even factors does 2160 have?
Answer. . For odd factors I ignore the 2s: (3 + 1)(1 + 1) = 8 odd factors. All factors: (4 + 1)(3 + 1)(1 + 1) = 40. So 40 − 8 = 32 are even.
Question 5
Find the sum of the odd factors and the sum of the even factors of 240.
Answer. . The odd factors add up to (1 + 3)(1 + 5) = 24. All the factors add up to (1 + 2 + 4 + 8 + 16)(1 + 3)(1 + 5) = 31 × 4 × 6 = 744. So the even factors add up to 744 − 24 = 720.
Question 6
How many factors of 3600 are perfect squares?
Answer. . A square factor uses only even powers. For 2 that is , or (3 choices), for 3 it is or (2 choices), and for 5 it is or (2 choices). So there are 3 × 2 × 2 = 12 square factors.
Question 7
Find the sum of all the square divisors of 1764.
Answer. . I put only the even powers in each bracket: (1 + 4)(1 + 9)(1 + 49) = 5 × 10 × 50 = 2500.
Question 8
In how many ways can 180 be written as a product of two natural numbers? In how many of these are the two numbers co-prime?
Answer. , so it has (2 + 1)(2 + 1)(1 + 1) = 18 factors. 180 is not a perfect square, so the factors pair up exactly: 18 ÷ 2 = 9 ways.
For co-prime pairs, each prime power (4, 9 and 5) has to go whole to one side. With 3 different primes that gives pairs: 1 × 180, 4 × 45, 9 × 20 and 5 × 36. So 4 of them are co-prime.
Question 9
Find the largest value of such that divides 24 × 36 × 50 × 18.
Answer. I count the 2s in each number. 24 = gives 3, 36 = gives 2, 50 = gives 1, and 18 = gives 1. Total = 3 + 2 + 1 + 1 = 7.
Question 10
Find the highest power of 7 that divides 500!.
Answer. I keep dividing by 7 and keep the whole parts: 500 ÷ 7 = 71, 71 ÷ 7 = 10, 10 ÷ 7 = 1. Adding them: 71 + 10 + 1 = 82. So divides 500!, but does not.
Question 11 [Tier 2]
Find the highest power of 12 that divides 50!.
Answer. 12 = . The 2s in 50!: 25 + 12 + 6 + 3 + 1 = 47, which is enough for 23 lots of . The 3s in 50!: 16 + 5 + 1 = 22. The 3s run out first, so the answer is 22.
Question 12
How many zeros are there at the end of 15 × 32 × 25 × 22 × 40 × 75 × 98 × 112 × 125?
Answer. I count 2s and 5s.
- 2s: 32 gives 5, 22 gives 1, 40 gives 3, 98 gives 1 and 112 gives 4. Total 14.
- 5s: 15 gives 1, 25 gives 2, 40 gives 1, 75 gives 2 and 125 gives 3. Total 9.
The smaller count is 9, so the product ends in 9 zeros.
Question 13
How many zeros are there at the end of 250!?
Answer. I count the 5s: 250 ÷ 5 = 50, 50 ÷ 5 = 10, 10 ÷ 5 = 2. Total 50 + 10 + 2 = 62. There are far more 2s than that, so 250! ends in 62 zeros.
Question 14
Which of these cannot be a perfect square? (a) 1,23,904 (b) 2,41,081 (c) 5,32,416 (d) 6,09,961
Answer. All four end in an allowed digit (4, 1, 6 and 1), so the last-digit test doesn't help. I try digital roots. (a) 1 + 2 + 3 + 9 + 0 + 4 = 19, then 1 + 9 = 10, then 1. (b) 16, then 7. (c) 21, then 3. (d) 31, then 4. A square can only have digital root 1, 4, 7 or 9, so (c) 5,32,416 cannot be a square. (The others are , and .)
Question 15
How many perfect squares lie between 300 and 3000?
Answer. is too small, so the first one inside is . is inside, but is too big. So the squares run from to , and there are 54 − 18 + 1 = 37 of them.
Question 16
What is the least number that must be subtracted from 6000 to get a perfect square? What is the least number that must be added?
Answer. and , so 6000 sits between them. To go down I subtract 6000 − 5929 = 71. To go up I add 6084 − 6000 = 84.
Question 17
Find the smallest number by which 2940 must be multiplied to make it a perfect square, and find the square root of the result.
Answer. . The 3 and the 5 have odd powers, so I multiply by 3 × 5 = 15. The result is 44,100 = , and its square root is 2 × 3 × 5 × 7 = 210.
Question 18
Find the least perfect square that is divisible by each of 10, 12, 15 and 18.
Answer. The LCM of 10, 12, 15 and 18 is 180 = . The 5 has no partner, so I multiply by 5: 180 × 5 = 900, which is .
Question 19
Find the square root of 1,07,584.
Answer. It ends in 4, so the root ends in 2 or 8. Dropping the last two digits leaves 1075. and , so the root is between 320 and 330, which means 322 or 328. = 1,05,625 (32 × 33 = 1056, then 25), and that is less than 1,07,584. So the root is above 325, and it is 328.
Question 20
A gardener has 7000 plants and wants to plant them with as many plants in each row as there are rows. How many plants are left over? How many more would he need for one extra row and column?
Answer. and . With 83 rows of 83 plants he uses 6889, so 7000 − 6889 = 111 are left over. For 84 rows of 84 he needs 7056 − 7000 = 56 more.
Question 21
and are positive integers and . Find .
Answer. , and 31 is prime. So and , which gives and . Then = 256 + 225 = 481.
Question 22
Find the smallest number by which 1323 must be multiplied to make it a perfect cube.
Answer. . The 3s are already a full cube. The 7 has power 2, so it needs one more 7. I multiply by 7: 1323 × 7 = 9261 = .