

Let first term of AP = a
common difference = d
number of terms = n
Given that sum of first 7 term of AP = 49
=> (n/2)*{2a + (n-1)*d} = 49
=> (7/2)*{2a + (7-1)*d} = 49
=> (7/2)*{2a + 6d} = 49
=> (1/2)*{2a + 6d} = 7
=> (2/2)*{a + 3d} = 7
=> a + 3d = 7...............1
Again given sum of first 17 term of AP = 289
=> (17/2)*{2a + (17-1)*d} = 289
=> (1/2)*{2a + 16*d} = 17 (when 17 and 289 is divided by 17)
=> (2/2)*{a + 8d} = 17
=> a + 8d = 17 ...............2
After solving equation 1 and 2, we get
a = 1 and d = 2
Now sum of n terms of AP = (n/2)*{2a + (n-1)*d}
=> (n/2)* {2*1 + (n-1)*2}
=> (n/2)* (2 + 2n - 2)
=> (n/2)*2n
=> n2
So sum of first n terms of AP = n2
