input: from typing import List
  
  def primeSieve(n: int) -> List[int]:
      """Construct a prime number sieve that returns a list of all primes up to a given number.
      >>> primeSieve(10)
      [2, 3, 5, 7]
      >>> primeSieve(20)
      [2, 3, 5, 7, 11, 13, 17, 19]
      """
output:     if n < 2:
          return []
      sieve = [True] * (n + 1)
      sieve[0] = sieve[1] = False
      for start in range(2, int(n**0.5) + 1):
          if sieve[start]:
              for multiple in range(start*start, n + 1, start):
                  sieve[multiple] = False
      return [num for num, is_prime in enumerate(sieve) if is_prime]