Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sum_of_descending_series(a, d, n):
- return (n / 2) * (2 * a + (n - 1) * d)
- a = 60 # First term
- d = -3 # Common difference
- n = (a - 1) // abs(d) + 1 # Number of terms
- sum = sum_of_descending_series(a, d, n)
- print("Sum of the series:", sum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement