input: Write a function to generate a prime number sequence up to a given number n. If the given number is less than 2, it should return an empty list.
  def generate_prime_numbers(n):
          if n < 2:
              return []
          primes = [True for i in range(n+1)]
          p = 2
          while (p * p <= n):
              if (primes[p] == True):
                  for i in range(p * p, n + 1, p):
                      primes[i] = False
              p += 1
          prime_numbers = [p for p in range(2, n+1) if primes[p]]
          return prime_numbers
  assert generate_prime_numbers(0) == []
  assert generate_prime_numbers(1) == []
  assert generate_prime_numbers(2) == [2]
  assert generate_prime_numbers(10) == [2, 3, 5, 7]
  assert generate_prime_numbers(20) == [2, 3, 5, 7, 11, 13, 17, 19]
output: def generate_prime_numbers(n):
          if n < 2:
              return []
          primes = [True for i in range(n+1)]
          p = 2
          while (p * p <= n):
              if (primes[p] == True):
                  for i in range(p * p, n + 1, p):
                      primes[i] = False
              p += 1
          prime_numbers = [p for p in range(2, n+1) if primes[p]]
          return prime_numbers