Ad
  • Custom User Avatar

    This is going to be invalidated as soon as I fix the tests. Sorry.

  • Custom User Avatar

    Strictly speaking, this is cheating, because the code doesn't produce an actual stream of primes – it passes the tests because they simply skip a large number of primes and never check them. But I'm impressed that this solution works at all, and by the amount of number theory involved, so I'll let it slide. :-)

    I didn't know there's a way to exactly calculate the nth prime. I guess your primeAt() function is only correct up to some n, right?