[Community Puzzle] Magic count of numbers

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

In this puzzle, my code passess all the tests but the ultimate test.

The ultimate test makes no sense. Since the list of primes is empty (k=0). There are no numbers divisible by “nothing” but the test expects 7664088964822. That makes me think that they are looking for a specific solution that when feeded with 0 outputs this aparently random value.

Can anyone help with this?

(Right now my code is outputing n if k is 0, but just a random solution)
n = 2147483647; k = 0

Failure

Found:
2147483647

Expected:
7664088964822

I think you’ve read the inputs wrong:

Thankyou! Solved with your help

Wow this is the shortest code I ever submitted for a Hard puzzle. I like the fact that I had serious difficulty with solving it without timing out, which forced me to explore several solutions before I arrived at one that worked. I feel as if I learned a thing or two - thanks for creating this contribution!