#Octave, 27 bytes
Octave, 27 bytes
@(x)lcm(1,num2cell(1:x){:})
Creates an anonymous function that can be invoked as ans(N).
Explanation
This solution creates a list of all numbers between 1 and x (1:x), converts them to a cell array with num2cell. Then the {:} indexing creates a comma-separated-list which is passed to lcm as multiple input arguments to compute the least common multiple. A 1 is always passed as the first argument to lcm because lcm always needs at least two input arguments.
#Octave, 27 bytes
@(x)lcm(1,num2cell(1:x){:})
Creates an anonymous function that can be invoked as ans(N).
Explanation
This solution creates a list of all numbers between 1 and x (1:x), converts them to a cell array with num2cell. Then the {:} indexing creates a comma-separated-list which is passed to lcm as multiple input arguments to compute the least common multiple. A 1 is always passed as the first argument to lcm because lcm always needs at least two input arguments.
Octave, 27 bytes
@(x)lcm(1,num2cell(1:x){:})
Creates an anonymous function that can be invoked as ans(N).
Explanation
This solution creates a list of all numbers between 1 and x (1:x), converts them to a cell array with num2cell. Then the {:} indexing creates a comma-separated-list which is passed to lcm as multiple input arguments to compute the least common multiple. A 1 is always passed as the first argument to lcm because lcm always needs at least two input arguments.
#Octave, 2527 bytes
@(x)lcm(1,num2cell(1:x){:})
Creates an anonymous function that can be invoked as ans(N).
Explanation
This solution creates a list of all numbers between 1 and x (1:x), converts them to a cell array with num2cell. Then the {:} indexing creates a comma-separated-list which is passed to lcm as multiple input arguments to compute the least common multiple. A 1 is always passed as the first argument to lcm because lcm always needs at least two input arguments.
#Octave, 25 bytes
@(x)lcm(num2cell(1:x){:})
Creates an anonymous function that can be invoked as ans(N).
Explanation
This solution creates a list of all numbers between 1 and x (1:x), converts them to a cell array with num2cell. Then the {:} indexing creates a comma-separated-list which is passed to lcm as multiple input arguments to compute the least common multiple.
#Octave, 27 bytes
@(x)lcm(1,num2cell(1:x){:})
Creates an anonymous function that can be invoked as ans(N).
Explanation
This solution creates a list of all numbers between 1 and x (1:x), converts them to a cell array with num2cell. Then the {:} indexing creates a comma-separated-list which is passed to lcm as multiple input arguments to compute the least common multiple. A 1 is always passed as the first argument to lcm because lcm always needs at least two input arguments.
#Octave, 25 bytes
@(x)lcm(num2cell(1:x){:})
Creates an anonymous function that can be invoked as ans(N).
Explanation
This solution creates a list of all numbers between 1 and x (1:x), converts them to a cell array with num2cell. Then the {:} indexing creates a comma-separated-list which is passed to lcm as multiple input arguments to compute the least common multiple.