Euler's sum of powers conjecture: Difference between revisions
Content deleted Content added
Line 1,734: | Line 1,734: | ||
(\(p, s) -> M.member (p - s) sumMap) |
(\(p, s) -> M.member (p - s) sumMap) |
||
(M.keys powerMap >>= |
(M.keys powerMap >>= |
||
( |
(((>>=) . flip takeWhile (M.keys sumMap) . (>)) <*> \ p s -> [(p, s)])) |
||
sumMapForRange :: [Int] -> M.Map Int (Int, Int) |
sumMapForRange :: [Int] -> M.Map Int (Int, Int) |
||
Line 1,760: | Line 1,760: | ||
xs = [1 .. 249] |
xs = [1 .. 249] |
||
sumsAndPowers = ((,) . sumMapForRange <*> powerMapForRange) xs |
sumsAndPowers = ((,) . sumMapForRange <*> powerMapForRange) xs |
||
showExample :: (M.Map Int (Int, Int), M.Map Int Int) -> [Int] -> (Int, Int) -> String |
showExample :: (M.Map Int (Int, Int), M.Map Int Int) -> [Int] -> (Int, Int) -> String |