(Somewhat) Fast Prime Number Generator
MrEconomical (2188)

Given a number N, this program calculates the Nth prime number.

Essentially, this program loops through all the odd numbers until it has found N prime numbers. To check if a number is prime, it checks divisbility by all the primes up to the sqrt of the number (which is why a primelist was generated), or if the sqrt is too big, it just loops through odd numbers.

Since repl.it is a "VM streamed over the internet," this program runs significantly slower than if it were to be run on your local machine, but it still is decently fast.

You are viewing a single comment. View All
qualladoom (320)

I think I just crashed the whole container with a number of 1 billion. oops