summaryrefslogtreecommitdiff
path: root/problem39.ijs
diff options
context:
space:
mode:
Diffstat (limited to 'problem39.ijs')
-rw-r--r--problem39.ijs7
1 files changed, 7 insertions, 0 deletions
diff --git a/problem39.ijs b/problem39.ijs
new file mode 100644
index 0000000..064ce73
--- /dev/null
+++ b/problem39.ijs
@@ -0,0 +1,7 @@
+perimeter =: {{ x+y+%:(x^2)+y^2 }}
+count =: monad define
+ pairs =. y=perimeter"0/~>:i.y
+ top =. <:/~i.y
+ +/,pairs*.top
+)
+problem39 =: >:{.\:count"0>:i.1e3 NB. Takes around 3-4 minutes to compute