LCM of 1 to n by nn

System.in.eachLine{for(x=i=1g;i++<it.toLong();)x*=i.divide(x.gcd(i))
println x}

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

download

return to the top page