Skip to content

Instantly share code, notes, and snippets.

@masylum
Created April 13, 2011 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masylum/917945 to your computer and use it in GitHub Desktop.
Save masylum/917945 to your computer and use it in GitHub Desktop.
let divisors n = [x | x <- [1..n], n `rem` x == 0, x /= n]
let subsets xs = (map concat . sequence) [ [[],[x]] | x <- xs ]
let sumSubsets xs = [sum x | x <- subsets xs, x /= []]
let challenge = [x | x <- [1..553], sum(divisors x) > x, all (/=x) (sumSubsets $divisors x)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment