import math
n = int(input("n = "))
S = sum(
[(((-1)**k * (k**3 - 27)) / math.factorial(3*(k + 2)))
for k in range(1, n+1)])
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
import math
n = int(input("n = "))
S = sum(
[(((-1)**k * (k**3 - 27)) / math.factorial(3*(k + 2)))
for k in range(1, n+1)])