A prime number has exactly two factors, 1 and itself: 2, 3, 5, 7, 11 and so on. A composite number has more than two factors, such as 12 = 2 × 2 × 3. The number 1 is neither, because it has only one factor.

  • 2 is the only even prime. Every other even number is divisible by 2.
  • There are 25 primes up to 100 and 168 up to 1,000.
  • Every whole number above 1 is either prime or a product of primes in exactly one way.

Prime questions in SSC and railway papers test two things: whether you can check a number quickly, and whether you recognise numbers that only look prime.

The answer to how to check a prime number quickly is to try dividing only by primes up to its square root. If none divides it, the number is prime.

  1. Find the whole-number part of √n. For 97 it is 9, because 9² = 81 and 10² = 100.
  2. List the primes up to that value: 2, 3, 5, 7.
  3. Test each one. If any divides n, it is composite; if none does, it is prime.

Worked example 1: is 97 prime?

97 is odd, its digit sum 16 is not a multiple of 3, it does not end in 0 or 5, and 97 ÷ 7 leaves 6. All 4 tests fail to divide it, so 97 is prime.

Use the divisibility rules for 2, 3, 5 and 11 to clear those primes in a glance, and divide only for 7, 13, 17 and beyond. For numbers up to 1,000 you never need a prime above 31, since 31² = 961 and 37² is already 1,369.

Some numbers pass the quick checks for 2, 3, 5 and 7 and look prime, but are products of two larger primes. Examiners like these because they catch anyone who stops testing early.

Worked example 2: 221

√221 is about 14.9, so test up to 13. 221 ÷ 13 = 17 exactly, with remainder 0. 221 = 13 × 17 is composite.

Worked example 3: 323

√323 is about 17.97, so test up to 17. 323 ÷ 17 = 19, remainder 0. 323 = 17 × 19.

Worked example 4: 1,001

1,001 = 7 × 11 × 13 = 1001. It is worth memorising, along with 91 = 7 × 13, 119 = 7 × 17, 143 = 11 × 13, 187 = 11 × 17 and 209 = 11 × 19.

Every prime greater than 3 is one more or one less than a multiple of 6. Numbers of the form 6k, 6k + 2 and 6k + 4 are even, and 6k + 3 is a multiple of 3, which leaves only 6k − 1 and 6k + 1.

Worked example 5: 89

89 ÷ 6 leaves remainder 5, so 89 = 6 × 15 − 1 and passes the filter. Testing 2, 3, 5 and 7 confirms it is prime.

The filter only rules numbers out. 25 = 6 × 4 + 1 passes it but is 5 × 5, so you still need the square-root test for anything that survives.

Two numbers are co-prime (relatively prime) when their HCF is 1, that is, they share no prime factor. Neither number has to be prime.

Worked example 6: 15 and 28

15 = 3 × 5 and 28 = 2² × 7 share no prime, so the HCF is 1: they are co-prime.

Worked example 7: 21 and 35

Both are multiples of 7, so the HCF is 7 and they are not co-prime.

Two facts make co-primes useful. Any two consecutive numbers are co-prime, and for a co-prime pair the LCM is simply the product.

Worked example 8: LCM of 8 and 15

They are co-prime, so LCM = 8 × 15 = 120. For more on this, see HCF and LCM of fractions.

To count the numbers from 1 to n that are co-prime to n, write n's distinct prime factors p, q, … and use n × (1 − 1/p) × (1 − 1/q) × …

Worked example 9: co-primes to 36

36 = 2² × 3², so the count is 36 × 1/2 × 2/3 = 12: 1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31 and 35. The powers do not matter, only the distinct primes.

  • Calling 1 a prime. It is neither prime nor composite.
  • Stopping at 7. For numbers above 121, test 11, 13 and beyond up to the square root.
  • Thinking co-primes must be primes. 8 and 15 are co-prime but both composite.
  • Trusting the 6k ± 1 filter alone. 25, 35 and 49 all pass it.
  • Using repeated primes in the co-prime count. For 36, use 2 and 3 once each.

For counting all the factors of a number, see number of factors.

Q1. Which of these numbers is prime? easy

✅ Answer: (c) 113

💡 Explanation: 91 = 7 × 13, 119 = 7 × 17 and 133 = 7 × 19. 113 is not divisible by 2, 3, 5 or 7, and √113 is below 11, so it is prime.

Q2. Which pair of numbers is co-prime? easy

✅ Answer: (a) (16, 27)

💡 Explanation: 16 = 2⁴ and 27 = 3³ share no prime factor, so their HCF is 1. The other pairs share 7, 5 and 6 respectively.

Q3. How many prime numbers lie between 50 and 70? medium

✅ Answer: (d) 4

💡 Explanation: Check the odd numbers 51 to 69 for 3, 5 and 7: only 53, 59, 61 and 67 survive. That makes 4 primes.

Q4. To test whether 437 is prime, what is the largest prime you need to try as a divisor? medium

✅ Answer: (b) 19

💡 Explanation: √437 is about 20.9, so the largest prime to try is 19. In fact 437 = 19 × 23, so it is composite.

Q5. How many numbers from 1 to 30 are co-prime to 30? hard

✅ Answer: (c) 8

💡 Explanation: 30 = 2 × 3 × 5, so the count is 30 × (1/2) × (2/3) × (4/5) = 8: 1, 7, 11, 13, 17, 19, 23 and 29.

Is 1 a prime number?

No. A prime has exactly two distinct factors, 1 and itself. The number 1 has only one factor, so it is neither prime nor composite.

Why is it enough to test divisors up to the square root?

If n = a × b with both factors above √n, their product would exceed n. So any composite number has at least one factor no bigger than √n, and checking primes up to √n is enough.

Do co-prime numbers have to be prime?

No. Co-prime only means the HCF is 1. 8 and 15 are both composite but co-prime, because they share no prime factor.

All problems and solutions on this page are original. No outside facts are relied on; every numeric answer is recomputed by software before publishing.

How this page was prepared. Drafted with AI assistance (Claude (Anthropic AI model)) from the sources listed above. 14 calculations on this page were recomputed by software and matched. Automated checks also covered structure, internal links and duplicate text. Software checks cannot confirm facts.

Found an error? Report it and we will correct the page.