If the first term is $a$ and $d$ is the increase then the first equation says
$\displaystyle 3 a+3 d=12$
the second equation
$\displaystyle 3 a^2+6 a d+5 d^2=66$
and the third one
$\displaystyle \frac{n}{2}(2a+(n-1)d)=51$
First, you are told that this is an arithmetic sequence so it must be of the form a, a+ d, a+ 2d, a+ 3d, etc. You are told that the sum of the first three numbers is 12: a+ (a+ d)+ (a+ 2d)= 3a+ 3d= 12 so a+ d= 4 and d= 4- a. If we also have that the sum of the squares is 66 then a^2+ (a+ d)^2+ (a+ 2d)^2= a^2+ a^2+ 2ad+ d^2+ a^2+ 4ad+ 4d^2= 3a^2+ 6ad+ 5d^2= 66. Replacing d with 4- a, 3a^2+ 6a(4- a)+ 5(4- a)^2= 3a^2+ 24a- 6a^2+ 80- 40a+ 5a^2= 2a^2- 16a+ 80= 66 or 2a^2- 16a+ 14= 2(a^2- 8a+ 7)= 2(a- 7)(a- 1)= 0. a is either 1 or 7. If a= 1 d= 4- 1= 3 so the sequence is 1, 4, 7, 10, 13, 16, etc. This is the sequence DenisB suggests. Continuing the sum, S1= 1, S2= 1+ 4= 6, S3= 1+ 4+ 7= 12, S4= 1+ 4+ 7+ 10= 22, S5= 1+ 4+ 7+ 10+ 13= 35, S6= 1+ 4+ 7+ 10+ 13+ 16= 51. n= 6 as Vinod suggests.
If a= 7, d= 4- 7= -3 so the sequence is 7, 4, 1, -2, -5, etc. But then S1= 7, S2= 11, S3= 12, S4= 10, S5= 5, S6= -3, and the sums are negative after this. In this case the sum is never 51 so the answer is n= 6.