Advertisement
STANAANDREY

LSD3 6

Oct 14th, 2022 (edited)
889
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.15 KB | None | 0 0
  1. def prim(n, d = 2):
  2.     if n == 1:
  3.         return False
  4.  
  5.     if n // 2 <= d:
  6.         return True
  7.  
  8.     return (n % d != 0) and prim(n, d + 1)
  9.  
  10.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement