This Python program reads an integer n and computes the result of the following series:
∑ [√(2k + 1) / (k³ + k)²] for k from 2 to n
It uses math.sqrt for accurate square root calculations.
import math
def compute_series(n: int) -> float:
total = 0.0
for k in range(2, n + 1):
numerator = math.sqrt(2 * k + 1)
denominator = (k ** 3 + k) ** 2
total += numerator / denominator
return total
# Read input from user
n = int(input("Enter value for n: "))
result = compute_series(n)
print(f"Series result is: {result:.6f}")
Series result is: 0.000271