import math


def erastosthenes_sieve(limit):
    """This function returns all the possible prime numbers of a given limit"""
    numbers = [True for _ in range(0, limit)]
    numbers[0] = numbers[1] = False

    for i in range(2,int(math.sqrt(limit))+1):
        for j in range(pow(i, 2), limit, i):
            if numbers[i]:
                numbers[j] = False
    
    return [x for x, y in enumerate(numbers) if y]