Prime Numbers by BugCreators

import math\x0d
\x0d
def is_prime(n):\x0d
    if n <= 1:\x0d
        return False\x0d
    if n == 2:\x0d
        print(n)\x0d
        return True\x0d
    if n > 2 and n % 2 == 0:\x0d
        return False\x0d
 \x0d
    divide = int(math.floor(math.sqrt(n)))\x0d
    for i in range(3, 1 + divide, 2):\x0d
        if n % i == 0:\x0d
            return False\x0d
    print(n)\x0d
    return True\x0d
 \x0d
count = 0\x0d
num = int(input())\x0d
for n in range(1,1000):\x0d
    x = is_prime(n)\x0d
    count += x\x0d
    if count > num - 1:\x0d
        break\x0d

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)

download

return to the top page