For a given n, write the function lcmSum(n), defined as follows:
For example for :
>> lcmSum = @(n) sum(lcm(n,1:n));
>> lcmSum(20)
ans =
2320
Since the sum grows very fast, please present your answer as a character string array and please limit the cody program size of the function to 150.

Solution Stats

21 Solutions

3 Solvers

Last Solution submitted on Jun 03, 2026

Last 200 Solutions

Solution Comments

Show comments
Loading...

Problem Recent Solvers3

Suggested Problems

More from this Author116

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!