Question
Write an algorithm that returns the sum of the sequence of numbers $s_{1}, \ldots, s_{n}$
Step 1
We can call this variable "total_sum" and set it to 0. This is because we haven't added any numbers yet. In LaTeX, this step can be written as: \[ \text{{total\_sum}} = 0 \] Show more…
Show all steps
Your feedback will help us improve your experience
Adriano Chikande and 69 other Precalculus educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Give a recursive algorithm for finding the sum of the first n positive integers.
Induction and Recursion
Recursive Algorithms
Give a recursive algorithm for finding the sum of the first $n$ odd positive integers.
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD