Problem 189. Sum all integers from 1 to 2^n
Solution Stats
Problem Comments
-
22 Comments
Carl Gauss's approach seems to be efficient for our brains but not for matlab
There are TWO problems with the way this problem is stated. Find them both!
Just go with your gut on this one.
John D'Errico wrote up some great commentary on this problem and how to go about solving it. http://blogs.mathworks.com/community/2016/07/21/numerical-analyst-john-derrico-takes-a-stroll-through-cody/
try to put to numbers in a range and sum them up
Additional test cases have been added.
Good one :)
very nice
easy easy
Gauss approves
fun solving :)
fun problem =/
yea
nice
nice stuff
nice
nice one
good question
nice
The question is soo easy that you won't be able to catch the trick soo easily.
Nice and easy beginners question using the sum function. Thanks Dimitris!
The question was easy and yes today only I completed the group Introduction to MATLAB few problems were very easy and few were tough ..... Happy to complete all the questions from this group
Solution Comments
Show commentsProblem Recent Solvers15391
Suggested Problems
-
Return elements unique to either input
771 Solvers
-
Who is the smartest MATLAB programmer?
753 Solvers
-
640 Solvers
-
Find out sum of all elements of given Matrix
501 Solvers
-
796 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!