f = @(x)lcm(1,num2cell(1:x){:}) f(1)f(2)f(3)f(4)f(5)f(6)f(7)
Standard input is empty
f = @(x) lcm (1, num2cell (1:x) {:}) ans = 1 ans = 2 ans = 6 ans = 12 ans = 60 ans = 60 ans = 420
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!