in 1st group there are 1 nos. 2nd grp - 3nos 3rg grp - 5nos
So, nth grp - (2n-1) nos
No. of terms before nth grp = 1 + 3 + 5 + .. + (2n-3) = (n-1)[2*1+(n-2)*2]/2 = (n-1)2
So, 1st term of nth grp + (n-1)2+1 and last term of nth grp = (n-1)2 + (2n-1)
So, sum of all terms in nth grp = (2n-1)(n-1)2 + (1+2+...+(2n-1))
= (2n-1)(n-1)2 + (2n-1)*2n/2
= (2n-1)(n2-n+1)