Skip to content

Instantly share code, notes, and snippets.

@cbilson
Created December 12, 2008 02:11
Show Gist options
  • Save cbilson/34991 to your computer and use it in GitHub Desktop.
Save cbilson/34991 to your computer and use it in GitHub Desktop.
#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