Course: CSCI 1900

Prime & Composite

ℕ can be expressed as a product of primes (prime factorization)

  • Prime → only evenly divisible by 1 and itself
  • Composite → everything else; more than two divisors

Greatest Common Divisor

  • The largest integer that divides both numbers
  • gcd(𝑎,𝑏)=𝑎×𝑏lcm(𝑎,𝑏)
  • gcd(24,108)
    • 24→2×2×2×3→23×31
    • 108→2×2×3×3×3→22×33

Prime Number Comparison

Prime Factor24=23×31108=22×33
22322
33133

Euclides Algorithm

  • gcd(24,108)
  • 108=4×24+12
  • 24=2×12+0→GCD=12

Least Common Multiple

  • lcm(𝑎,𝑏)=𝑎×𝑏gcd(𝑎,𝑏)
  • The largest power of either prime factor
  • lcm(24,108)=23×33→216