from typing import List


def sieve_of_eratosthenes(n: int) -> List[int]:
    """
    Simple Sieve of Eratosthenes algorithm to return all primes up to n.
    :param n: the upper bound on the primes
    :return: the list of primes in order

    >>> sieve_of_eratosthenes(0)
    []
    >>> sieve_of_eratosthenes(1)
    []
    >>> sieve_of_eratosthenes(2)
    [2]
    >>> sieve_of_eratosthenes(3)
    [2, 3]
    >>> sieve_of_eratosthenes(60)
    [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59]
    """
    primes = []
    sieve = [False, False] + [True] * (n - 1)
    for i in range(2, n + 1):
        # Skip non-primes.
        if not sieve[i]:
            continue

        # Add new primes and then extend the sieve.
        primes.append(i)

        # Get rid of all multiples.
        idx = i
        while idx <= n:
            sieve[idx] = False
            idx += i

    return primes