Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def prim(n, d = 2):
- if n == 1:
- return False
- if n // 2 <= d:
- return True
- return (n % d != 0) and prim(n, d + 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement