Advertisement
immanual1

2j

Jan 13th, 2025
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. def sum_of_descending_series(a, d, n):
  2. return (n / 2) * (2 * a + (n - 1) * d)
  3.  
  4. a = 60 # First term
  5. d = -3 # Common difference
  6. n = (a - 1) // abs(d) + 1 # Number of terms
  7. sum = sum_of_descending_series(a, d, n)
  8. print("Sum of the series:", sum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement