Number Theory Basics
Primes, divisors and gcd, covering the sieve, factorising with a smallest-prime table, divisors in square-root time and the gcd properties contests lean on.
The problem
Many problems ask about primes (numbers above 1 with no divisors except 1 and themselves), divisors, or the greatest common divisor (gcd, the largest number dividing both). Typical questions:
- Is prime? Which numbers up to are prime?
- What is the prime factorisation of (for example )?
- List all divisors of , or count them.
- What is and (least common multiple)?
1 of 9