input: Write a function to implement the Sieve of Eratosthenes algorithm to find all prime numbers up to a given number n. The function should return a list of all prime numbers found. If the input is less than 2, the function should return an empty list.
  def sieve_eratosthenes(n):
      if n < 2:
          return []
      prime_list = [True] * (n+1)
      prime_list[0] = prime_list[1] = False
      for start in range(2, int(n**0.5) + 1):
          if prime_list[start]:
              for multiple in range(start*start, n+1, start):
                  prime_list[multiple] = False
      return [num for num, is_prime in enumerate(prime_list) if is_prime]
  
  assert sieve_eratosthenes(10) == [2, 3, 5, 7]
  assert sieve_eratosthenes(20) == [2, 3, 5, 7, 11, 13, 17, 19]
  assert sieve_eratosthenes(1) == []
  assert sieve_eratosthenes(0) == []
  assert sieve_eratosthenes(-5) == []
output: def sieve_eratosthenes(n):
      if n < 2:
          return []
      prime_list = [True] * (n+1)
      prime_list[0] = prime_list[1] = False
      for start in range(2, int(n**0.5) + 1):
          if prime_list[start]:
              for multiple in range(start*start, n+1, start):
                  prime_list[multiple] = False
      return [num for num, is_prime in enumerate(prime_list) if is_prime]