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 Solvers15304
Suggested Problems
-
Find the sum of all the numbers of the input vector
49113 Solvers
-
1741 Solvers
-
Multiples of a Number in a Given Range
615 Solvers
-
5213 Solvers
-
750 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!