👁 Preview — Study, Practice and Revise are open; mock tests and the rest of the syllabus unlock on subscription. Unlock all · ₹4,999
← Back to Numbers and Basic Operations
Study mode

Prime and composite numbers

Prime and Composite Numbers

Every number has certain numbers that divide it exactly without leaving any remainder. These numbers are called factors. For example, factors of 6 are 1, 2, 3, and 6 because each divides 6 exactly.

Understanding factors helps us classify numbers into two special groups: prime numbers and composite numbers. This classification is important because it helps us solve many math problems, especially in competitive exams.

Before we start, it is important to know that the number 1 is neither prime nor composite, and 0 is a special number that does not fit into these categories.

What Are Factors?

A factor of a number is a number that divides it exactly without leaving a remainder.

Example: Factors of 10 are 1, 2, 5, and 10 because:

  • 10 / 1 = 10 (no remainder)
  • 10 / 2 = 5 (no remainder)
  • 10 / 5 = 2 (no remainder)
  • 10 / 10 = 1 (no remainder)

Prime Numbers

A prime number is a number greater than 1 that has exactly two distinct factors: 1 and the number itself.

In other words, a prime number cannot be divided evenly by any other number except 1 and itself.

Examples of prime numbers: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, ...

Notice that 2 is the only even prime number because every other even number can be divided by 2, making them composite.

7 (Prime) 7 1 7 15 (Composite) 15 3 5

Composite Numbers

A composite number is a number greater than 1 that has more than two factors.

This means composite numbers can be divided evenly by numbers other than 1 and itself.

Examples of composite numbers: 4, 6, 8, 9, 12, 15, 18, 20, 24, 30, ...

We can find the prime factors of composite numbers by breaking them down step-by-step using a factor tree.

12 (Composite) 12 2 6 2 3

From the factor tree above, the prime factors of 12 are 2, 2, and 3.

Special Cases: 0 and 1

Number 1: It has only one factor, which is 1 itself. Since prime numbers need exactly two factors, 1 is neither prime nor composite.

Number 0: It is a special number that can be divided by every number, so it does not fit into prime or composite categories.

Remember: 1 is neither prime nor composite. 0 is not classified as either.

Divisibility Rules

Divisibility rules help us quickly check if a number can be divided by another number without performing full division. This is very useful to identify factors and decide if a number is prime or composite.

Divisor Rule Example
2 Number ends with 0, 2, 4, 6, or 8 24 ends with 4 -> divisible by 2
3 Sum of digits is divisible by 3 123 -> 1+2+3=6, 6 divisible by 3 -> 123 divisible by 3
5 Number ends with 0 or 5 45 ends with 5 -> divisible by 5

Worked Examples

Example 1: Is 17 Prime or Composite? Easy
Check if the number 17 is prime or composite.

Step 1: List factors of 17 by checking divisibility from 1 to 17.

Step 2: 17 / 1 = 17 (no remainder), 17 / 17 = 1 (no remainder).

Check other numbers: 2, 3, 4 ... none divide 17 exactly.

Step 3: Since only 1 and 17 divide 17 exactly, it has exactly two factors.

Answer: 17 is a prime number.

Example 2: Factorizing 18 to Find if it is Prime or Composite Easy
Use a factor tree to find the prime factors of 18 and decide if it is prime or composite.

Step 1: Start with 18 at the top.

Step 2: Find two factors of 18: 2 and 9 (because 2 x 9 = 18).

Step 3: Break down 9 into factors: 3 and 3.

Step 4: All factors at the ends (2, 3, 3) are prime numbers.

Answer: 18 is composite because it has more than two factors (1, 2, 3, 6, 9, 18).

Example 3: Using Divisibility Rules to Check if 35 is Prime or Composite Medium
Use divisibility rules to check if 35 is prime or composite.

Step 1: Check divisibility by 2: 35 ends with 5, so not divisible by 2.

Step 2: Check divisibility by 3: sum of digits 3 + 5 = 8, which is not divisible by 3.

Step 3: Check divisibility by 5: number ends with 5, so divisible by 5.

Step 4: Since 35 is divisible by 5 (other than 1 and 35), it has more than two factors.

Answer: 35 is a composite number.

Example 4: Finding Prime Numbers Between 20 and 30 Medium
List all prime numbers between 20 and 30.

Step 1: List numbers: 21, 22, 23, 24, 25, 26, 27, 28, 29.

Step 2: Check each number:

  • 21: divisible by 3 and 7 -> composite
  • 22: divisible by 2 -> composite
  • 23: no divisors other than 1 and 23 -> prime
  • 24: divisible by 2, 3, 4, 6, 8, 12 -> composite
  • 25: divisible by 5 -> composite
  • 26: divisible by 2 -> composite
  • 27: divisible by 3 -> composite
  • 28: divisible by 2, 4, 7, 14 -> composite
  • 29: no divisors other than 1 and 29 -> prime

Answer: The prime numbers between 20 and 30 are 23 and 29.

Example 5: Prime Factorization of 60 Medium
Find the prime factors of 60 using a factor tree.

Step 1: Start with 60.

Step 2: Break 60 into two factors: 6 and 10 (6 x 10 = 60).

Step 3: Break 6 into 2 and 3 (both prime).

Step 4: Break 10 into 2 and 5 (both prime).

Step 5: Collect all prime factors: 2, 2, 3, and 5.

Answer: Prime factorization of 60 is \(2 \times 2 \times 3 \times 5\) or \(2^2 \times 3 \times 5\).

Formula Bank

Formula Bank

Prime Number Definition
\[ n \text{ is prime} \iff \text{factors}(n) = \{1, n\} \]
where: \(n\) = any natural number greater than 1
Composite Number Definition
\[ n \text{ is composite} \iff \exists a,b \in \mathbb{N}, 1 < a,b < n \text{ such that } n = a \times b \]
where: \(n\) = any natural number greater than 1; \(a,b\) = factors of \(n\)

Tips & Tricks

Tip: Remember that 2 is the only even prime number.

When to use: When quickly checking if an even number is prime.

Tip: Use divisibility rules for 2, 3, and 5 to quickly identify composite numbers.

When to use: When testing if a number is composite without full factorization.

Tip: If a number is not divisible by any prime number less than or equal to its square root, it is prime.

When to use: For checking primality of larger numbers efficiently.

Tip: Use factor trees to break down composite numbers into prime factors step-by-step.

When to use: When performing prime factorization.

Common Mistakes to Avoid

❌ Assuming 1 is a prime number.
✓ 1 is neither prime nor composite because it has only one factor.
Why: Students confuse the definition of prime numbers requiring exactly two factors.
❌ Thinking all even numbers are composite.
✓ 2 is an even number but is prime.
Why: Students overlook the special case of 2.
❌ Not checking all possible factors up to the square root of the number.
✓ Check divisibility only up to the square root of the number for efficiency.
Why: Students try to check all factors unnecessarily, wasting time.
❌ Confusing factors with multiples.
✓ Factors divide the number exactly; multiples are numbers obtained by multiplying the number.
Why: Terminology confusion leads to errors in identifying primes and composites.
Key Concept

Prime vs Composite Numbers

Prime numbers have exactly two factors: 1 and itself. Composite numbers have more than two factors.

Curated videos per subtopic
Top YouTube explainers, AI-ranked for your exam and language. Unlocks with subscription.
Unlock

Try Practice next.

Progress tracking is paywalled — subscribe to mark subtopics as understood and save your streak.

Go to practice →
Ask a doubt
Prime and composite numbers · 10 free messages
Ask me anything about this subtopic. You have 10 free messages this session — chat history isn't saved in preview.