Explanation:
I think you made a typo.
this should be
4, 7, 12, 19
the differences between the terms are then
3, 5, 7
so, the next difference should be 9, and then 11 and so forth.
that means we are adding 2 more (not just 2) every time we create a new term.
a1 = 4
a2 = a1 + 3 = 7
a3 = a2 + (a2 - a1) + 2 = a1 + 3 + (a1 + 3 - a1) + 2 =
= a1 + 2×3 + 1×2 = a1 + 4×2 = 12
a4 = a3 + (a3 - a2) + 2 =
= (a2 + (a2 - a1) + 2) + (a2 + (a2 - a1) + 2 - a2) + 2 =
= (a1 + 3 + (a1 + 3 - a1) + 2) + (a1 + 3 + (a1 + 3 - a1) + 2 - a1 - 3) + 2 =
= (a1 + 2×3 + 2) + 1×3 + 2 + 2 =
= a1 + 3×3 + 3×2 = a1 + 5×3 = 19
this tells us
an = a1 + (n+1)(n-1) = 4 + n² - 1 = n² + 3
f(n) = n² + 3