input: Write a python function to find all prime numbers up to a given number using the Sieve of Eratosthenes algorithm.
  assert sieve_eratosthenes(10) == [2, 3, 5, 7]
  assert sieve_eratosthenes(30) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
  assert sieve_eratosthenes(50) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]
output: def sieve_eratosthenes(n):
      primes = []
      sieve = [True] * (n + 1)
      for p in range(2, n + 1):
          if sieve[p]:
              primes.append(p)
              for multiple in range(p * p, n + 1, p):
                  sieve[multiple] = False
      return primes