\(\Leftrightarrow n\left(a_{n+2}-a_{n+1}\right)=\left(n+1\right)\left(a_{n+1}-a_n\right)+3n\left(n+1\right)\)
\(\Leftrightarrow\dfrac{a_{n+2}-a_{n+1}}{n+1}=\dfrac{a_{n+1}-a_n}{n}+3\)
Đặt \(\dfrac{a_{n+1}-a_n}{n}=b_n\Rightarrow\left\{{}\begin{matrix}b_1=\dfrac{a_2-a_1}{1}=-6\\b_{n+1}=b_n+3\end{matrix}\right.\)
\(\Rightarrow b_n\) là cấp số cộng với công sai 3
\(\Rightarrow b_n=b_1+\left(n-1\right)d=-6+3\left(n-1\right)=3n-9\)
\(\Rightarrow a_{n+1}-a_n=n\left(3n-9\right)=3n^2-9n\)
\(\Rightarrow a_{n+1}-\left(n+1\right)^3+6\left(n+1\right)^2-5\left(n+1\right)=a_n-n^3+6n^2-5n\)
Đặt \(a_n-n^3+6n^2-5n=c_n\Rightarrow\left\{{}\begin{matrix}c_1=6-1+6-5=6\\c_{n+1}=c_n=...=c_1=6\end{matrix}\right.\)
\(\Rightarrow a_n=n^3-6n^2+5n+6\)