LCM of 1 to n by pooq

load(functs);r:1;while(x:?read(?-,?-,~))#~do(sum(r:lcm(r,i),i,1,x),printf(?t,"~d
",r));

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

download

return to the top page