I have a doubt in the following problem.

Determine if the following series converges or diverges. If it converges determine its sum.

It is given that the general formula for the partial sums is,

But I dont understand how we get this formula. Can you please help me