Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sum_of_odd_squares(n):
- if n % 2 == 0:
- n -= 1
- return (n * (n + 1) * (2 * n + 1)) // 6
- n = int(input("Enter the value of N: "))
- sum = sum_of_odd_squares(n)
- print("Sum of the series:", sum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement