Created
June 2, 2013 09:58
-
-
Save smallgeek/5693201 to your computer and use it in GitHub Desktop.
n 以下の完全数リスト
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 perfectNumbers n = | |
| let isPerfect n = | |
| [1 .. n / 2] | |
| |> List.filter (fun i -> n % i = 0) | |
| |> List.sum = n | |
| [1 .. n] | |
| |> List.filter isPerfect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment