euler/Problem036.hs

8 lines
269 B
Haskell

-- Find the sum of all numbers, less than one million, which are palindromic in
-- base 10 and base 2.
import Euler
main = print $ sum $ [ n | n <- [1..999999], isPalindrome (toDigits n),
isPalindrome (toDigitsBase 2 n) ]