import math


def primes_list(lower, upper):
    """Problem 39: A list of prime numbers

    Parameters
    ----------
    lower : int
        The lower bound of the prime numbers to return
    upper : int
        The upper bound of the prime numbers ro return

    Returns
    -------
    list of int
        A list of prime integer numbers

    """
    # Implemented the Sieve of Eratosthenes
    a = (upper + 1) * [True]
    for i in range(2, int(math.sqrt(upper)) + 1):
        if a[i]:
            j = i * i
            while j <= upper:
                a[j] = False
                j += i
    return [i + lower for i, x in enumerate(a[lower:]) if x]