Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

solved euler 55

  • Loading branch information...
commit 3d817a52a3ae705cbde6a3d9eaf345c8f95490e5 1 parent a9cbb96
@Swizec authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 project-euler/55.hs
View
14 project-euler/55.hs
@@ -0,0 +1,14 @@
+
+reverse' = read . reverse . show
+
+palindrome n = n == reverse' n
+
+-- max denotes max recursion depth
+lychrel n max
+ | max <= 0 = True
+ | palindrome$n+r = False
+ | otherwise = lychrel (n+r) (max-1)
+ where r = reverse' n
+
+lychrels max =
+ length [x | x <- [1..max], lychrel x 50]
Please sign in to comment.
Something went wrong with that request. Please try again.