DEV Community

Discussion on: Calculating Prime Numbers with CircleCI

Collapse
 
0xyasser profile image
Yasser A • Edited

Interesting!
I'm wondering if you are going to reach the limit of CircleCI builds if you use the free account.
I would recommend filling the list with the first 10 or 100 million primes at least then let it run.
you could do that easily with a python script using the below code. it won't take that long at all

def primes_sieve(limit):
    limitn = limit+1
    not_prime = [False] * limitn
    primes = []

    for i in range(2, limitn):
        if not_prime[i]:
            continue
        for f in range(i*2, limitn, i):
            not_prime[f] = True

        primes.append(i)

    return primes
print(primes_sieve(10000000))

Collapse
 
nicklavrov profile image
Nick Lavrov

Ah, according to their pricing plan here, I get 1500 minutes of build time per month for free. So the build will fail once it hits that limit, I suppose.