Loading topic
a % b gives the remainder when a is divided by b) and can read short Python functions that use loops and list comprehensions. The previous chapter used remainders to define divisibility. This chapter uses divisibility to sort the int3 min read%, and can read short Python functions with loops and lists.3 min readn % d returns.3 min read%), can read Python loops and functions, and have seen Big-O notation. It also uses the definition from earlier chapters: a prime is an integer greater than 1 whose only positive divisors are 1 and itself.2 min readd * d <= n. Here you will see why that bound is correct, why it is the tightest simple bound, and how to write it without floating-poi3 min readn always has a factor no larger than its square root. Trial division tests one number at a time. When you need every prime up to some limit n, testing each number separately repea3 min readp you cross out its multiples. You should also be comfortable with Python loops and range with a step. The question here is narrower. When you reach prime3 min readln, base e). The goal is to estimate how many primes lie below n without counting them. That estimate also explains how much work the sieve does3 min read&, |, <<, and >>.2 min read