已知数列an满足a(n+1)=an+3n+2,且a1=2,求an