asked 84.8k views
5 votes
Use a loop to compute the sum Σ 8 -1 !

asked
User Thies
by
8.0k points

1 Answer

5 votes

Final answer:

To compute the sum Σ 8 -1 ! using a loop, you can iterate from 8 down to 1, calculate the factorial of each number, and add it to the sum.

Step-by-step explanation:

To compute the sum of Σ 8 - 1 ! using a loop, we can start with a variable, let's call it 'sum', initialized to 0. Then, we can use a loop to iterate from 8 down to 1. In each iteration, we subtract 1 from the current number and calculate its factorial. We add the factorial to the 'sum' variable. Finally, when the loop finishes, the 'sum' variable will contain the desired sum.

Here's an example in Python:

sum = 0
for i in range(8, 0, -1):
factorial = 1
for j in range(1, i+1):
factorial *= j
sum += factorial
print(sum)

answered
User Elboulangero
by
8.9k points

No related questions found

Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.