Advertisement
immanual1

2g

Jan 13th, 2025
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. def sum_of_triple_products(n1, n2, n3):
  2. sum = 0
  3. for i in range(1, n1 + 1):
  4. sum += i * (i + 2) * (i + 3)
  5. return sum
  6.  
  7. n1 = int(input("Enter the value of n1: "))
  8. n2 = int(input("Enter the value of n2: "))
  9. n3 = int(input("Enter the value of n3: "))
  10. sum = sum_of_triple_products(n1, n2, n3)
  11. print("Sum of the series:", sum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement