92/uiua: even faster with chunked threading and memoization

This commit is contained in:
2025-10-07 09:03:10 +02:00
parent f4f8a9fb3f
commit 7223098285

View File

@@ -1,7 +1,5 @@
# next number in chain
N ← /+⍉°√⊥10
N ← memo(/+⍉°√⊥10) # memoize, because we get many repeated 1s
⍜-⇡1 1e7
⍥N10 # the longest 1-chain is less than 10
-⊙1e7 ⧻⊚=1 # count 1s to subtract from 1e7
-1 # there are 999999 nums, because no 0
°△ 1e4_1e3 # chunk the input
wait≡pool⍥₁₀N # thread each chunk of size 1e3
-⊃(⧻⊚=1|-₁⧻♭)