Created
December 12, 2008 02:11
-
-
Save cbilson/34991 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#light | |
open System | |
(* | |
My solution to project euler problem #7 | |
*) | |
let isPrime x = | |
{2 .. int(System.Math.Sqrt(float(x)))} | |
|> Seq.filter(fun d -> x % d = 0) |> Seq.is_empty | |
let primes = | |
seq { for x in 2 .. Int32.MaxValue do | |
if isPrime x then yield x } | |
let problem7 = | |
Seq.nth (10001 - 1) primes | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment