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 Solvers15180
Suggested Problems
-
Remove all the words that end with "ain"
2273 Solvers
-
2341 Solvers
-
Read a column of numbers and interpolate missing data
2277 Solvers
-
Return the first and last characters of a character array
9802 Solvers
-
Electrical Diode Current Calculation
600 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!