Created
September 19, 2010 07:29
-
-
Save ldunn/586529 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| let rec primesIn (ns: int list) (x: int) = | |
| let newList = | |
| (x :: ((List.choose (fun y -> | |
| match y with | |
| | y when (y % x <> 0) -> Some y | |
| | _ -> None) ns).Tail)) | |
| if newList.[0]*newList.[1] <> newList.[newList.Length-1] then | |
| primesIn newList.Tail newList.[1] | |
| else ns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment