$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · medium · #323

What goes in the blank?

# sieve of Eratosthenes, prime i found
for j in range(i * i, n + 1, ____):
    is_prime[j] = False

Answer: i (also accepted: i)

Step by i to hit every multiple. Starting at i * i is safe because smaller multiples were crossed off by smaller primes.
Play Problem Solving ▸