Do you just want the next two terms? Or
do you want the general formula?
Regardless of which you want we have
to make a difference table:
List the terms in a row:
-2 5 21 51 100
Now subtract each number from the number
just right of it to find the first differences:
-2 5 21 51 100
7 16 30 49
Now do the same with the first differences.
Subtract each number from the number just right
of it to find the second differences:
-2 5 21 51 100
7 16 30 49
9 14 19
Now do the same with the second differences.
Subtract each number from the number just right
of it to find the third differences:
-2 5 21 51 100
7 16 30 49
9 14 19
5 5
They are both the same, 5. It took the third difference
to get them the same.
Now if all you want are the next two terms, we just need
to extend this table, by putting two more 5's
beside those two and working backwards:
-2 5 21 51 100
7 16 30 49
9 14 19
5 5 5 5
Working backwards, add the first 5 to the 19 getting 24,
put that to the right of the 19 above and between the
5's that we added:
-2 5 21 51 100
7 16 30 49
9 14 19 24
5 5 5 5
Still working backwards, add the second 5 to the 24 getting 29,
put that to the right of the 24:
-2 5 21 51 100
7 16 30 49
9 14 19 24 29
5 5 5 5
Still working backwards, add the second 24 to the 49 getting 73,
put that to the right of the 49, above and between the 24 and 29:
-2 5 21 51 100
7 16 30 49 73
9 14 19 24 29
5 5 5 5
Still working backwards, add the second 29 to the 73 getting 102,
put that to the right of the 73:
-2 5 21 51 100
7 16 30 49 73 102
9 14 19 24 29
5 5 5 5
Still working backwards, add the second 73 to the 100 getting 173,
put that to the right of the 100, above and between the 73 and the
102 (that's the next term)
-2 5 21 51 100 173
7 16 30 49 73 102
9 14 19 24 29
5 5 5 5
Still working backwards, finally add the second 102 to the 173
getting 275,
put that to the right of the 173. That's the other term
-2 5 21 51 100 173 275
7 16 30 49 73 102
9 14 19 24 29
5 5 5 5
So the next two terms are 173 and 275
-2, 5, 21, 51, 100, 173, 275
---------------------------------------------
Now to find the general term.
You mentioned these two formulas:
a+(n-1)d and a+(n-1)d+1/2(n-1)(n-2)c
The first formula is for when the FIRST differences are all the same.
The second formula is for when the SECOND differences are all the same.
These won't do since neither the first or second differences were all
the same. But there is a third formula for when the THIRD differences
are all the same:
a+(n-1)d+1/2!(n-1)(n-2)c+1/3!(n-1)(n-2)(n-3)b
d = the left-most number in the row of first differences
c = the left-most number in the row of second differences
b = the left-most number in the row of third differences
That formula can be extended as far as needed until the case
where the nth differences are all the same.
So the general term here is:
-2+(n-1)(7)+(1/2)(n-1)(n-2)(9)+(1/6)(n-1)(n-2)(n-3)(5)
Multiply that all out, get it all over one denominator
and you get:
(5n³-3n²+16n-30)/6
Edwin