04 Try it yourself Interactive
Choose a number and step through it. The console checks the parity, works out the square-root limit, then tries primes in order and halts the instant one divides. Watch the divisions counter — that number is the payoff for knowing where to stop.