Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.23 KB | None | 0 0
  1. let rec pierwszaPrim (n: int) (k: int) =
  2.     match n, k with
  3.     | 1, _ -> false
  4.     | 2, _ -> true
  5.     | _, 2 -> not ((n % 2) = 0)
  6.     | _, _ -> not ((n % k) = 0) && pierwszaPrim n (k-1)
  7.    
  8. let pierwsza n = pierwszaPrim n (n-1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement