Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sum_of_arithmetic_series(a, d, n):
- return (n / 2) * (2 * a + (n - 1) * d)
- a = 1 # First term
- d = 4 # Common difference
- n = int(input("Enter the value of N: "))
- sum = sum_of_arithmetic_series(a, d, n)
- print("Sum of the series:", sum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement