Project Euler Problem 055
import Data.List import Data.Char import Control.Applicative isparin :: Show a => a -> Bool isparin x= ((==)<*>reverse) $ show x iter :: Integer -> Integer iter x = x + (foldl1 ((+).(*10))) (map (fromIntegral.digitToInt) $ reverse $ show x) islycher :: (Eq a, Num a) => a -> Integer -> Bool islycher 0 _ = True islycher n x = if isparin r then False else islycher (n-1) r where r = iter x ans1 :: Int ans1 = length $ filter (islycher (50::Integer)) [1..9999] --249 main :: IO () main = print ans1