Can anyone explain the maths used in this question

problem link
Here i’m unable to understand in editorial how we genrate the formula for the sum of terms and how it was simplified

1 Like