Problem 189. Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.
Solution Stats
Problem Comments
-
22 Comments
Show
19 older comments
Abdullah Al Baki
on 27 Apr 2022
The question is soo easy that you won't be able to catch the trick soo easily.
DJ Campbell
on 12 May 2023
Nice and easy beginners question using the sum function. Thanks Dimitris!
AMIT SURYAVANSHI
on 21 Jan 2024
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 commentsGroup

Programování - Cody
- 12 Problems
- 466 Finishers
- Find the sum of all the numbers of the input vector
- Maximum value in a matrix
- Make the vector [1 2 3 4 5 6 7 8 9 10]
- Return area of square
- Select every other element of a vector
- Triangle Numbers
- Check if number exists in vector
- Create times-tables
- Determine whether a vector is monotonically increasing
- Roll the Dice!
- Verify Law of Large Numbers
- Solve a System of Linear Equations
Problem Recent Solvers15881
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!