solve 26 in uiua (FAST)

This commit is contained in:
2025-09-22 00:46:47 +02:00
parent d281923802
commit b9e7fa86d5

14
26/main.ua Normal file
View File

@@ -0,0 +1,14 @@
# project euler 26
# divide a by b, doing one iteration of long division.
# ? b a
Div ← ×10-⊸(×⌊⤚÷)
# we will have to perform long division at most 1000
# times, so just do it 1000 times for all numbers
# below 1000, pervasively.
# use the steps to determine cycle lengths.
1000
⍥⟜⊸Div⟜⊃⇡(↯⊙1) # pervasively repeat long division.
⊢⊚=⊸/↥≡(⧻◴)⍉ # cycle length is dedup length.