Guest User

Untitled

a guest
Feb 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #light
  2.  
  3. open System
  4.  
  5. (*
  6. My solution to project euler problem #7
  7. *)
  8.  
  9. let isPrime x =
  10. {2 .. int(System.Math.Sqrt(float(x)))}
  11. |> Seq.filter(fun d -> x % d = 0) |> Seq.is_empty
  12.  
  13. let primes =
  14. seq { for x in 2 .. Int32.MaxValue do
  15. if isPrime x then yield x }
  16.  
  17. let problem7 =
  18. Seq.nth (10001 - 1) primes
Add Comment
Please, Sign In to add comment