diff --git a/26/main.ua b/26/main.ua new file mode 100644 index 0000000..a979b14 --- /dev/null +++ b/26/main.ua @@ -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.