Skip to content

Instantly share code, notes, and snippets.

@smallgeek
Created June 2, 2013 09:58
Show Gist options
  • Select an option

  • Save smallgeek/5693201 to your computer and use it in GitHub Desktop.

Select an option

Save smallgeek/5693201 to your computer and use it in GitHub Desktop.
n 以下の完全数リスト
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