Given- Sum of first 4 terms of an AP is 40 and first 14 term is 280.
∵Sn= sum of n terms of an A.P. =n2[2a+(n−1)d]
⇒S₄=40=42[2a+3d]=2a+3d=20...........(1)
and
S₁₄=280=142[2a+13d]=2a+13d=40.........(2)
solving (1) and (2)
Gives a=7 and d=2
So Sn=n2[2(7)+(n−1)2]=7n+n²−n=n²+6n