AMC // 10
LEARN>NUMBER THEORY>DIVISIBILITY & PRIMES
// CONCEPT // NUMBER THEORY

DIVISIBILITY & PRIMES

Quick tests for divisibility, prime factorization, and counting divisors.

Overview

Divisibility and primes are the foundation of number theory on the AMC10. A positive integer nn is divisible by dd if dividing nn by dd leaves remainder zero — equivalently, dnd \mid n means n=dkn = d \cdot k for some integer kk.

Why the AMC10 loves this topic: Many competition problems reduce to asking whether a number has a special form (prime, perfect square, highly composite) or asking you to count divisors or factor an expression. Recognizing 720 as 243252^4 \cdot 3^2 \cdot 5 in two seconds is a real skill.

Prime factorization (the Fundamental Theorem of Arithmetic) says every integer greater than 1 can be written uniquely as a product of prime powers: n=p1a1p2a2pkak.n = p_1^{a_1} \cdot p_2^{a_2} \cdots p_k^{a_k}. From this one expression you can read off the number of divisors, the sum of divisors, GCD, LCM, and more.

Key facts

  • Divisibility by 2: last digit is even.
  • Divisibility by 4: last two digits form a number divisible by 4.
  • Divisibility by 8: last three digits form a number divisible by 8.
  • Divisibility by 3 or 9: digit sum divisible by 3 (or 9). Use when: checking large numbers by hand.
  • Divisibility by 5: last digit is 0 or 5.
  • Divisibility by 11: alternating digit sum (d1d2+d3)(d_1 - d_2 + d_3 - \cdots) is divisible by 11. Use when: the answer choices hint at a near-11 structure.
  • Counting divisors: if n=p1a1pkakn = p_1^{a_1} \cdots p_k^{a_k} then the number of positive divisors is τ(n)=(a1+1)(a2+1)(ak+1)\tau(n) = (a_1+1)(a_2+1)\cdots(a_k+1).
  • Sum of divisors: σ(n)=p1a1+11p11p2a2+11p21\sigma(n) = \dfrac{p_1^{a_1+1}-1}{p_1-1} \cdot \dfrac{p_2^{a_2+1}-1}{p_2-1} \cdots Use when: the problem asks for the sum of all divisors.
  • Perfect squares: a divisor dd of n=p1a1pkakn = p_1^{a_1}\cdots p_k^{a_k} is a perfect square iff all its prime exponents are even. Count them as (a1/2+1)(ak/2+1)\bigl(\lfloor a_1/2\rfloor+1\bigr)\cdots\bigl(\lfloor a_k/2\rfloor+1\bigr).
  • Primality testing: trial-divide by all primes n\leq \sqrt{n}. If none divide nn, it's prime. The first 10 primes: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29.
  • Prime gaps / distribution: primes thin out as numbers grow, but there is no largest prime. Bertrand's postulate: for every n>1n > 1 there is always a prime pp with n<p<2nn < p < 2n.

Worked example 1

How many positive divisors does 180180 have?

Factor: 180=445=22325180 = 4 \cdot 45 = 2^2 \cdot 3^2 \cdot 5.

Apply the formula: τ(180)=(2+1)(2+1)(1+1)=332=18\tau(180) = (2+1)(2+1)(1+1) = 3 \cdot 3 \cdot 2 = 18.

You can also list them systematically: multiply each combination of {1,2,4}\{1,2,4\}, {1,3,9}\{1,3,9\}, {1,5}\{1,5\} — but the formula is faster and less error-prone.

Worked example 2

Find the number of positive integers n50n \leq 50 such that n2n^2 has exactly 99 positive divisors.

τ(n2)=9\tau(n^2) = 9 requires n2n^2's prime-exponent list to satisfy (ei+1)=9\prod(e_i+1)=9.

99 factors as 9=99 = 9 or 9=3×39 = 3 \times 3.

  • Case 99: n2=p8n^2 = p^8, so n=p4n = p^4. For n50n \leq 50: n=24=16n = 2^4 = 16 only (34=81>503^4 = 81 > 50).
  • Case 3×33 \times 3: n2=p2q2n^2 = p^2 q^2, so n=pqn = pq with p<qp < q distinct primes. Count pairs (p,q)(p,q) with pq50pq \leq 50:
    • p=2p = 2: q{3,5,7,11,13,17,19,23}q \in \{3,5,7,11,13,17,19,23\} → 8 values
    • p=3p = 3: q{5,7,11,13}q \in \{5,7,11,13\} → 4 values
    • p=5p = 5: q{7}q \in \{7\} → 1 value (5×11=55>505 \times 11 = 55 > 50)

Total: 1+8+4+1=141 + 8 + 4 + 1 = \mathbf{14}.

Common traps

  • Forgetting p=1p = 1 in exponent counts: The exponents in τ(n)=(a1+1)(ak+1)\tau(n) = (a_1+1)\cdots(a_k+1) start at ai=0a_i = 0, which corresponds to not including pip_i at all. Always add 1.
  • Divisibility by 9 vs. 3: digit sum divisible by 3 is not the same as divisible by 9. For 9, the digit sum itself must be divisible by 9.
  • Confusing τ\tau with σ\sigma: τ\tau counts divisors, σ\sigma sums them. Read the question.
  • Overlooking 1 and nn as divisors: both are always divisors; a prime pp has exactly 2.
  • Assuming a number is prime without checking: always trial-divide up to n\sqrt{n} before declaring primality.