Number theory starts with divisibility and primes β the atoms of the integer world. Know the divisibility rules, understand what makes a number prime, and master the Sieve of Eratosthenes. These are the foundation for everything else in number theory: GCD, LCM, modular arithmetic, and beyond.
An integer $a$ is divisible by a nonzero integer $b$ if there exists an integer $k$ such that $a = b \cdot k$.
Notation: $ b \mid a $ (read "b divides a")
Examples: $ 3 \mid 12 $ because 12 = 3 \(\times\) 4. $ 5 \nmid 12 $ because 12 isn't a multiple of 5.
Properties:
Why these work: \(Because 10 \\equiv 0 mod 2,5; 10 \\equiv 1 mod 3,9; 10 \\equiv -1 mod 11. We'll prove this properly with modular arithmetic later.\)
A positive integer greater than 1 is:
Important notes:
An efficient algorithm to find all primes up to a given number n:
Optimization: you only need to check up to $\sqrt{n}$ because any composite n must have a factor \(\leq \sqrt{n}.\)
Every positive integer can be written uniquely as a product of primes (up to ordering).
This is the Fundamental Theorem of Arithmetic.
Example: $ 84 = 2^2 \times 3 \times 7 $
How to factor: divide by small primes repeatedly, or use factor trees.
If a prime $p$ divides the product $ab$, then $p$ divides $a$ or $p$ divides $b$ (or both).
This is why primes are "atomic" β they can't be split across factors. If a prime shows up in a product, it must come entirely from one factor or the other.
\(Important: this only works for primes! Composite numbers don't have this property (e.g., 6 divides 4 \\times 3 but 6 doesn't divide 4 or 3 individually).\)
If $ n = p_1^{a_1} \cdot p_2^{a_2} \cdot ... \cdot p_k^{a_k} $, then the number of positive divisors is:
\[ d(n) = (a_1 + 1)(a_2 + 1)...(a_k + 1) \]
Because for each prime, you can choose exponent 0 through $a_i$ in the divisor. We'll cover this more in the GCD/LCM module.
Divisibility by 3: sum the digits, check if divisible by 3.
Step 1: Sum the digits of 1,236.
1 + 2 + 3 + 6 = 12
Step 2: Is 12 divisible by 3?
12 Γ· 3 = 4, which is an integer. Yes!
Step 3: Verify: 1,236 Γ· 3 = 412. β
Answer: 1 (yes)
Step 1: Divide by smallest prime (2) repeatedly.
180 Γ· 2 = 90
90 Γ· 2 = 45
45 is odd β can't divide by 2 anymore. Got $2^2$.
Step 2: Next prime (3).
45 Γ· 3 = 15
15 Γ· 3 = 5
Got $3^2$.
Step 3: Next prime (5).
5 Γ· 5 = 1
Got $5^1$.
Step 4: Write it out.
\[ 180 = 2^2 \times 3^2 \times 5^1 \]
a = 2, b = 2, c = 1
a + b + c = 2 + 2 + 1 = 5
Answer: 5
Use Sieve of Eratosthenes thinking.
\((\sqrt{30} \\approx\) 5.5, so we only need to check primes 2, 3, and 5.\)
Step 1: List numbers 1-30, mark composites.
Start with 2: mark 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30
Next prime 3: mark 6, 9, 12, 15, 18, 21, 24, 27, 30
Next prime 5: mark 10, 15, 20, 25, 30
\(We're done (next prime is 7, and 7 > \sqrt{30}).\)
Step 2: Count unmarked numbers (primes).
2, 3, 5, 7, 11, 13, 17, 19, 23, 29
That's 10 primes.
Note: 1 is not prime.
Answer: 10