diff --git a/62 b/62 new file mode 100755 index 0000000..38ca184 Binary files /dev/null and b/62 differ diff --git a/62.hi b/62.hi new file mode 100644 index 0000000..19cac99 Binary files /dev/null and b/62.hi differ diff --git a/62.hs b/62.hs new file mode 100644 index 0000000..3f4844d --- /dev/null +++ b/62.hs @@ -0,0 +1,27 @@ +import Data.List + +cubes = [n * n * n | n <- [4142..9999]] + +arePermutations :: Integer -> Integer -> Bool +arePermutations a b = null (aStr \\ bStr) && null (bStr \\ aStr) + where aStr = show a + bStr = show b + +permutes = [(a, b, c, d, e) | a <- cubes, + b <- cubes, + a < b, + arePermutations a b, + + c <- cubes, + b < c, + arePermutations b c, + + d <- cubes, + c < d, + arePermutations c d, + + e <- cubes, + d < e, + arePermutations d e] + +main = print $ head permutes diff --git a/62.o b/62.o new file mode 100644 index 0000000..dcd9d90 Binary files /dev/null and b/62.o differ