+ 8
first of all, infinite series must be convergent to find its sum,
if it's diverging then you can't find the sum.
for converging series you can easily derive an generalised expression for it's sum,
just do some maths and get the simplified expression and use it in your code.
you can also code from scratch, just add all the cases to test the convergence of series, and then find the possible expression of sum, you'll get the result.