summaryrefslogtreecommitdiff
path: root/problem37.ijs
diff options
context:
space:
mode:
Diffstat (limited to 'problem37.ijs')
-rw-r--r--problem37.ijs7
1 files changed, 7 insertions, 0 deletions
diff --git a/problem37.ijs b/problem37.ijs
new file mode 100644
index 0000000..bebb9de
--- /dev/null
+++ b/problem37.ijs
@@ -0,0 +1,7 @@
+enc =: 10&#.
+digits =: enc^:_1
+truncs =: monad : '(1-#y)+i._1+2*#y'
+truncations =: monad : '; enc@:}.&y each truncs y'
+truncatablePrime =: monad : '*./1&p: truncations digits y'"0
+primes =: 4}.p:i.1e5 NB. A good guess :)
+problem37 =: +/(truncatablePrime#]) primes