Primes

Primes: testing, factorizing, listing, counting
One big number: no setup, any x < 2^64
Many small numbers: build the sieve once, O(N · log(log N))
Listing primes
Counting primes without listing them
Prime Templates — LeetGoat