From 0e51ddd6203e0227146df8600bd01f6c5df34c3b Mon Sep 17 00:00:00 2001 From: fredrikr79 Date: Sat, 4 Oct 2025 09:41:02 +0200 Subject: [PATCH] solve 39 in uiua (2 min SLOW) --- 39/main.ua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 39/main.ua 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.