0
0

Even, Odd, Prime, Composite

Introduction

Classifying numbers as even, odd, prime, or composite is fundamental to number theory and aptitude problems. These categories help in pattern recognition, divisibility shortcuts, and building techniques for more advanced problems like factorization and modular arithmetic.

Pattern: Even, Odd, Prime, Composite

Pattern

Use simple divisibility and divisor-count rules to classify integers quickly.

  • Even: An integer n is even if n ≡ 0 (mod 2). In practice: last digit ∈ {0,2,4,6,8}.
  • Odd: An integer n is odd if n ≡ 1 (mod 2). Last digit ∈ {1,3,5,7,9}.
  • Prime: An integer p > 1 is prime if its only positive divisors are 1 and p. Practical test: check divisibility by all primes ≤ √p.
  • Composite: An integer n > 1 that has a divisor d with 1 < d < n (i.e., more than two positive divisors).
  • Special note: 1 is neither prime nor composite.
  • Quick primality shortcuts:
    • If n is even and n > 2 → composite.
    • If sum of digits divisible by 3 (and n > 3) → composite.
    • If last digit 0 or 5 (and n > 5) → composite.
    • Only candidates for primes > 3 are of form 6k ± 1 (useful to skip checks), but still test divisibility up to √n.
    • Sieve of Eratosthenes: efficient way to list primes up to N (cross out multiples of found primes).
  • Formal primality test (practical): To test n: check divisibility by 2, 3, then all primes 5, 7, 11, ... up to ⌊√n⌋. If none divide n → prime; else composite.

Step-by-Step Example

Question

Classify the numbers 1, 2, 29, and 49 as even/odd and prime/composite.

Solution

  1. Step 1: Number: 1

    Check: 1 <= 1, it has exactly one positive divisor (1). By definition, 1 is neither prime nor composite. It is odd (last digit 1), but categorized as "neither" for prime/composite classification.

  2. Step 2: Number: 2

    Check even/odd: last digit 2 → even.

    Prime test: 2 > 1 and its divisors are 1 and 2 only → prime (smallest and only even prime).

  3. Step 3: Number: 29

    Check even/odd: last digit 9 → odd.

    Prime test (practical): √29 ≈ 5.38 → test primes ≤ 5 → {2,3,5}.

    • 29 mod 2 = 1 (not divisible)
    • 29 mod 3 = 2 (not divisible)
    • 29 mod 5 = 4 (not divisible)

    No divisors found → 29 is prime.

  4. Step 4: Number: 49

    Check even/odd: last digit 9 → odd.

    Prime test: √49 = 7 → test primes ≤ 7 → {2,3,5,7}.

    • 49 mod 2 = 1
    • 49 mod 3 = 1
    • 49 mod 5 = 4
    • 49 mod 7 = 0 → divisible by 7

    Found divisor 7 (1 < 7 < 49) → 49 is composite (49 = 7 × 7).

  5. Final Answer

    1 → neither prime nor composite (odd);
    2 → even & prime;
    29 → odd & prime;
    49 → odd & composite.

  6. Quick Check

    Verify divisions used above: 29 has no small prime divisors (2,3,5). 49 ÷ 7 = 7 confirms composite. 2 ÷ 2 = 1 confirms prime. 1 is special-case by definition. ✅

Quick Variations

1. Identify prime pairs (twin primes) like (11,13), (17,19).

2. Determine if a large odd number is prime using trial division up to √n or probabilistic tests for very large n.

3. Factor small composites by checking primes ≤ √n.

Trick to Always Use

  • Step 1 → Check last digit for even/odd quickly.
  • Step 2 → Eliminate composites fast: test 2, 3, 5 using last digit and digit-sum rules.
  • Step 3 → For primality, only test divisors up to √n (and only prime divisors for efficiency).
  • Step 4 → Use the 6k ± 1 filter to skip obvious non-candidates when testing primes > 3.

Summary

Summary

  • Even/odd classification is determined directly from the last digit.
  • Prime/composite classification depends on divisor checks: a prime has exactly two divisors (1 and itself), while composites have more.
  • 1 is a special case - it is neither prime nor composite.
  • 2 is the only even prime; all other even numbers greater than 2 are composite.

Example to remember:
Check last digit first for even/odd. For prime testing, check divisibility by 2, 3, 5, and then primes up to √n. If none divide, the number is prime.

Practice

(1/5)
1. Which of the following numbers is prime?
easy
A. 29
B. 33
C. 39
D. 51

Solution

  1. Step 1: Strategy:

    To test primality for numbers like 29, check divisibility by primes ≤ √29 (i.e., 2, 3, 5).
  2. Step 2: Tests:

    29 mod 2 = 1 (not divisible), 29 mod 3 = 2 (not divisible), 29 mod 5 = 4 (not divisible). Other options: 33 = 3 × 11 (composite), 39 = 3 × 13 (composite), 51 = 3 × 17 (composite).
  3. Final Answer:

    29 is prime → Option A.
  4. Quick Check:

    No prime ≤5 divides 29, so 29 is prime. ✅
Hint: Test divisibility by small primes (2,3,5) up to √n.
Common Mistakes: Assuming odd → prime without checking divisors.
2. Which of the following is a composite number?
easy
A. 17
B. 23
C. 25
D. 19

Solution

  1. Step 1: Strategy:

    Composite numbers have more than two positive divisors; check for small factor patterns.
  2. Step 2: Tests:

    17 → prime. 23 → prime. 25 → 5 × 5 → composite. 19 → prime.
  3. Final Answer:

    25 is composite → Option C.
  4. Quick Check:

    25 ÷ 5 = 5 confirms composite (divisors: 1,5,25). ✅
Hint: Spot squares of primes (e.g., 25, 49) - they are composite.
Common Mistakes: Treating square numbers as prime.
3. Which of the following numbers is even and composite?
easy
A. 13
B. 28
C. 17
D. 31

Solution

  1. Step 1: Strategy:

    Even numbers end with 0,2,4,6,8; among evens, check if the number has divisors other than 1 and itself (i.e., not 2).
  2. Step 2: Tests:

    13 → odd prime. 28 → ends with 8 (even); 28 = 4 × 7 (has divisors other than 1 and itself) → composite. 17, 31 → odd primes.
  3. Final Answer:

    28 is even and composite → Option B.
  4. Quick Check:

    28 ÷ 4 = 7 and last digit 8 confirm even composite. ✅
Hint: All even numbers > 2 are composite unless the number is 2.
Common Mistakes: Forgetting that 2 is the only even prime.
4. Which of the following numbers is neither prime nor composite?
medium
A. 1
B. 2
C. 3
D. 4

Solution

  1. Step 1: Definitions:

    Prime: integer > 1 with exactly two positive divisors (1 and itself). Composite: integer > 1 with more than two positive divisors. Numbers ≤ 1 are special cases.
  2. Step 2: Tests:

    1 → has exactly one positive divisor (1) → by standard convention, neither prime nor composite. 2 → prime. 3 → prime. 4 → composite (2 × 2).
  3. Final Answer:

    1 is neither prime nor composite → Option A.
  4. Quick Check:

    Recall standard convention: 1 is classified as neither prime nor composite. ✅
Hint: Remember: 1 is neither; 2 is the only even prime.
Common Mistakes: Misclassifying 1 as prime or composite.
5. Which of the following numbers has exactly three positive divisors?
medium
A. 27
B. 16
C. 15
D. 49

Solution

  1. Step 1: Key fact:

    A number has exactly three positive divisors iff it is the square of a prime (p^2), because divisors are {1, p, p^2}.
  2. Step 2: Tests:

    27 = 3^3 (more than 3 divisors). 16 = 2^4 (divisors: 1,2,4,8,16 → 5 divisors). 15 = 3 × 5 (divisors 1,3,5,15 → 4 divisors). 49 = 7^2 → divisors {1,7,49} → exactly 3 divisors.
  3. Final Answer:

    49 → Option D.
  4. Quick Check:

    49 is 7^2; divisors 1, 7, 49 confirm exactly three divisors. ✅
Hint: Look for prime-square form p^2 to get exactly three divisors.
Common Mistakes: Confusing p^2 with higher prime powers (which have more divisors).

Mock Test

Ready for a challenge?

Take a 10-minute AI-powered test with 10 questions (Easy-Medium-Hard mix) and get instant SWOT analysis of your performance!

10 Questions
5 Minutes