aboutsummaryrefslogtreecommitdiffhomepage
path: root/samples/euler/002.bruijn
diff options
context:
space:
mode:
Diffstat (limited to 'samples/euler/002.bruijn')
-rw-r--r--samples/euler/002.bruijn13
1 files changed, 13 insertions, 0 deletions
diff --git a/samples/euler/002.bruijn b/samples/euler/002.bruijn
new file mode 100644
index 0000000..a0b614c
--- /dev/null
+++ b/samples/euler/002.bruijn
@@ -0,0 +1,13 @@
+:import std/Combinator .
+:import std/List .
+:import std/Math .
+
+# could be arbitrary >34, chosen by manual min search
+lim (+34)
+
+solve [∑(crit <#> (take lim fibs))]
+ crit φ [[0 1 0]] even? (\les? 0)
+
+:test ((solve (+4000)) =? (+3382)) ([[1]])
+
+main [solve (+4000000)]