If the general term formula of sequence {an} is a quadratic function of N and A1 = 2, A2 = 6, A3 = 12, find the general term formula of {an} N is under a

If the general term formula of sequence {an} is a quadratic function of N and A1 = 2, A2 = 6, A3 = 12, find the general term formula of {an} N is under a

Let an = Mn ^ 2 + PN + Q... (*)
n=1,a1=2
n=2,a2=6
n=3,a3=12
Substituting (*)
m+p+q=2
4m+2p+q=6
9m+3p+q=12
The solution is m = 1, P = 1, q = 0
an=n^2+n