input: Write a function to print out the first n prime numbers using the Sieve of Eratosthenes algorithm. The function should take an integer n as input and return a list of the first n prime numbers. If n is 0, the function should return an empty list.
  
  def first_n_primes(n):
      def sieve_of_eratosthenes(n):
          if n == 0: return []
          primes = [True] * (n+1)
          primes[0] = primes[1] = False
          for i in range(2, int(n**0.5)+1):
              if primes[i]:
                  for j in range(i*i, n+1, i):
                      primes[j] = False
          return [i for i, is_prime in enumerate(primes) if is_prime][:n]
      limit = 2
      while True:
          primes = sieve_of_eratosthenes(limit)
          if len(primes) >= n:
              return primes[:n]
          limit *= 2
  
  assert first_n_primes(0) == []
  assert first_n_primes(1) == [2]
  assert first_n_primes(5) == [2, 3, 5, 7, 11]
  assert first_n_primes(10) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
output: def first_n_primes(n):
      def sieve_of_eratosthenes(n):
          if n == 0: return []
          primes = [True] * (n+1)
          primes[0] = primes[1] = False
          for i in range(2, int(n**0.5)+1):
              if primes[i]:
                  for j in range(i*i, n+1, i):
                      primes[j] = False
          return [i for i, is_prime in enumerate(primes) if is_prime][:n]
      limit = 2
      while True:
          primes = sieve_of_eratosthenes(limit)
          if len(primes) >= n:
              return primes[:n]
          limit *= 2