diff --git a/39/main.ua b/39/main.ua new file mode 100644 index 0000000..af479a1 --- /dev/null +++ b/39/main.ua @@ -0,0 +1,22 @@ +# project euler 39 + +S ← ⧻( + ⊸(▽⊸( + =/+⊃↙₂⊣°√ ⍉ + ) ⧅<3 +1⇡⌊÷2) + ▽⤚(=/+ ⍉) +) + +# same as S but filters in different order +S′ ← ⧻( + ⊸(⧅<3 +1⇡⌊÷2) + ▽⤚(=/+ ⍉) + ▽⊸(=/+⊃↙₂⊣°√ ⍉) +) + +⊢▽⊸(=⟜/↥wait≡poolS′) +1⇡1000 + +# ⊃($new ⊙◌⍜nowS′|$old ⊙◌⍜nowS) 840 + +# it seems S' is faster on bigger numbers (roughly), +# and it pays off here, barely.