Project Euler #50: Consecutive prime sum

  • + 2 comments

    python3

    I get everything but test case 9. Curriously, 9 sumtimes returns "Wrong answer" and other times returns "Runtime Error." Has anyone else run into this?

    For some reason hackerrank is failing to post my comment with the code pasted.

    • + 0 comments

      my tests for 2, 3, 4, 5, 10, 100, 1000, 1000000, 1000000000, and 1000000000000 all return correct results as expected.

    • + 0 comments

      Found the issue. I was sieving up to 2x10^7. For N > 2x10^7 which were themselves the solution (eg. 20027257), the algorithm was returning the longest series < N (when it should be <=N). It was only happening at N larger than my sieve limit, though, so my other tests didn't catch it.