• Custom User Avatar

    You seem to confuse primes generator with primarily test. Sieves are not tests, they are prime generators. To test for a prime you do not need prime generators. You could use one, but not in the most trivial way of generating all primes up to N.

  • Custom User Avatar

    2000000000 is the maximum value tested in random tests in Python. On your computer you can only do the basic tests, which are easy and not numerous ones.

  • Custom User Avatar

    @akar-0: I guess Eratostenes never thought of calculating such high numbers :S thx for the hint.

  • Custom User Avatar

    This is a very classic mathematical problem, and an easy 6 kyu kata. You need to use another method, make an online search and you'll find easily. Any hint we could give you would spoil the solution.

    Just one thing: to find out if a number is prime, you don't need all the primes below it. Actually you don't need any of them, you just need to check... it's prime.

  • Custom User Avatar

    Try a few tests with n = 2000000000 or similar.

  • Custom User Avatar

    thx for the link, but you can help me to understand why? in my machine "execution time : 0.021 s" and tests here allways says under 600ms.

  • Custom User Avatar

    Don't spoil solution on discourse page, thanks.

  • Custom User Avatar

    Your approach is very inefficient. This is not a kata issue. See there: https://docs.codewars.com/training/troubleshooting/

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution