teacher
Sign in

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.

40 minCF 900–16005 interactive11 problems

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 nn prime? Which numbers up to 10610^6 are prime?
  • What is the prime factorisation of xx (for example 360=23⋅32⋅5360 = 2^3 \cdot 3^2 \cdot 5)?
  • List all divisors of nn, or count them.
  • What is gcd⁡(a,b)\gcd(a, b) and lcm⁡(a,b)\operatorname{lcm}(a, b) (least common multiple)?
1 of 9