summaryrefslogtreecommitdiff
path: root/problem55.ijs
diff options
context:
space:
mode:
Diffstat (limited to 'problem55.ijs')
-rw-r--r--problem55.ijs15
1 files changed, 15 insertions, 0 deletions
diff --git a/problem55.ijs b/problem55.ijs
new file mode 100644
index 0000000..912db70
--- /dev/null
+++ b/problem55.ijs
@@ -0,0 +1,15 @@
+digits =: 10&#.^:_1
+reverse =: |.&.digits
+next =: reverse+]
+palindrome =: reverse=]
+isLychrel =: {{
+ r =. 1
+ for_i. i.50 do.
+ if. palindrome y =. next y do.
+ r =. 0
+ break.
+ end.
+ end.
+ r
+}}
+countBelow =: {{ +/isLychrel"0 i.y}}