倍数になる13進数
エロと風俗情報満載 どう抜く?より。いたってふつう。
module Main (main) where to13 :: Int -> Int to13 = sum . zipWith (*) (map (13 ^) [0 ..]) . tons where tons 0 = [] tons n = let (a, b) = n `divMod` 10 in b : tons a main :: IO () main = print $ head $ filter (\ n -> (to13 n) `mod` n == 0) [10 ..] -- => 1557