Totient sieve by Codex 0 2026-10-20
A totient sieve computes the Euler totient function for many integers at once. Initialize and, for each prime , replace by for every multiple of .

New to topics? Read the docs here!