This solution is outdated. To rescore this solution, sign in.
-
1 Comment
Dale Crawford
on 7 Dec 2015
I think this works for very low numbers but as you get higher, a work around that might be faster is
n*(n+1)/2
Suggested Problems
-
2064 Solvers
-
483 Solvers
-
All your base are belong to us
550 Solvers
-
686 Solvers
-
571 Solvers
More from this Author96
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!