input: 
  def sieve_eratosthenes(limit):
      """
      Implement the Sieve of Eratosthenes algorithm to find all prime numbers up to a given limit.
      
      >>> sieve_eratosthenes(10)
      [2, 3, 5, 7]
      >>> sieve_eratosthenes(20)
      [2, 3, 5, 7, 11, 13, 17, 19]
      >>> sieve_eratosthenes(50)
      [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]
      """
  
output:     if limit < 2:
          return []
      is_prime = [True] * (limit + 1)
      is_prime[0] = is_prime[1] = False
      for i in range(2, int(limit**0.5) + 1):
          if is_prime[i]:
              for j in range(i*i, limit + 1, i):
                  is_prime[j] = False
      return [i for i in range(limit + 1) if is_prime[i]]