LCM of 1 to n by 51b(embed)

-module(l).
-export([m/0]).
m()->[io:write(f(X))>io:nl()||X<-"\x01\x02\x03\x04\x05\x06
\x19d"++[1000]].
f(1)->1;f(X)->Y=f(X-1),hd([Y*N||N<-lists:seq(1,X),Y*N rem X<1]).

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

download

return to the top page