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 Solvers15305
Suggested Problems
-
27525 Solvers
-
640 Solvers
-
Create a two dimensional zero matrix
489 Solvers
-
Side of an equilateral triangle
6141 Solvers
-
792 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!