Series: 6, 13, 24, 39, 58
1st diff: 7, 11, 15, 19
2nd diff: 4, 4, 4
An extra term has been added to the series to illustrate what appears to be the pattern.
The second difference is constant and this suggest a quadratic function for the nth term, an.
Let the quadratic function be f(n)=an2+bn+c where a, b and c are constant coefficients.
f(1)=6=a+b+c
f(2)=13=4a+2b+c
f(3)=24=9a+3b+c
Now we have 3 equations and 3 unknowns so we can calculate a, b and c.
f(2)-f(1)=7=3a+b;
f(3)-f(2)=11=5a+b.
Therefore 11-7=4=2a, so a=2, b=1, c=3. f(n)=an=2n2+n+3.
f(4)=2×16+4+3=39 which matches expectation from the series.
Also, f(5)=2×25+5+3=58.
To find the sum of the series, Sn=2∑n2+∑n+3n.
Sum of the natural numbers: n(n+1)/2.
Sum of the squares of natural numbers: 1, 5, 14, 30, 66,...=n(n+1)(2n+1)/6.
Sn=2n(n+1)(2n+1)/6+n(n+1)/2+3n,
Sn=(2n(n+1)(2n+1)+3n(n+1)+18n)/6,
Sn=n(n+1)(4n+2+3+18/(n+1))/6,
Sn=n(n+1)(4n+5+18/(n+1))/6,
Sn=n(4n2+9n+23)/6.
S1=6, S2=19, S3=43, S4=82; S5=140 from the formula.
S2-S1=a2=13; S3-S2=a3=24; S4-S3=a4=39; S5-S4=a5=58.
These match the series.