Problem 45761. Sum of terms in a series 1 (★★★)
Given x and n, compute the following sum:
where |x| indicates the absolute value of x. Thus, if x = -5 and n = 3, then the sum is (up to n = 3 terms)
|-5|+|-5|^(1/2)+|-5|^(1/3)
= 5+5^(1/2)+5^(1/3)
= 8.946
Avoid using for/while loops.
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers54
Suggested Problems
-
Number of 1s in a binary string
10676 Solvers
-
9890 Solvers
-
665 Solvers
-
782 Solvers
-
Finding perimeter of a rectangle
490 Solvers
More from this Author52
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!