LCM of 1 to n by yshl

[.runstdin]{[1]1 1 3 index{/n exch def dup aload 0 exch length{10 mul add n
mod}repeat n{{1 index mod exch}loop}stopped/n n 4 index idiv def[0 6 index{n
mul add dup 10 mod exch 10 idiv}forall -6000 1{}for]}for aload
length{=only}repeat/ =}forall

Note that non-ascii characters in the above source code will be escaped (such as \x9f).


return to the top page