Skip to content

Instantly share code, notes, and snippets.

@nicokosi
Last active February 9, 2016 05:16
Show Gist options
  • Save nicokosi/524ce1284b820759eaa0 to your computer and use it in GitHub Desktop.
Save nicokosi/524ce1284b820759eaa0 to your computer and use it in GitHub Desktop.
import Data.List
main = do
putStrLn $ unwords $ map show $ filter isWonderNumber [100000..10000000]
isWonderNumber :: Integer -> Bool
isWonderNumber x = all (== digits x) (map digits (multiples x))
multiples :: Integer -> [Integer]
multiples x = map (* x) [2..6]
digits :: Integer -> String
digits x = sort $ show x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment