Question 1124987
<br>
The first term is a; the second is b; so the common difference is (b-a).<br>
The n-th term is then the first term plus the common difference (n-1) times:
{{{c = a + (n-1)(b-a)}}}
{{{c = a + nb - na - b + a}}}
{{{c = 2a-b+nb-na}}}
{{{b+c-2a = n(b-a)}}}
{{{n = (b+c-2a)/(b-a)}}}  <-- answer to the first question<br>
The sum of the series is (number of terms) times (average of first and last terms):<br>
{{{S = n((a+c)/2)}}}
{{{S = ((b+c-2a)/(b-a))((a+(2a-b+nb-na))/2)}}}
{{{S = ((b+c-2a)(3a-b+nb-na))/(2(b-a))}}}  <-- answer to the second question<br>
Let's check these formulas with an example -- just in case we made an error in our algebra....<br>
a = 3; b = 5; 9 terms.<br>
The common difference is b-a = 2; the 9th term, c, is 3+8(2) = 19.<br>
We know the number of terms is 9; our formula says the number of terms  should be<br>
{{{(b+c-2a)/(b-a)}}}
{{{(5+19-2(3))/(5-3) = 18/2 = 9}}}<br>
Our formula gives the right result for this example.<br>
The sum of the series is {{{9((3+19)/2) = 9*11 = 99}}}.<br>
Our formula says the sum is supposed to be<br>
{{{((b+c-2a)(3a-b+nb-na))/(2(b-a))}}}
{{{((5+19-2(3))(3(3)-5+9(5)-9(3)))/(2(5-3))}}}
{{{((24-6)(9-5+45-27))/4 = (18*22)/4 = 9*11 = 99}}}<br>
Our formula for the sum also gives the right result for this example.