We have recurrence relation
an=−3an−1−3an−2−an−3
Characteristic polynomial:
λ3+3λ2+3λ+1=0(λ+1)3=0λ=−1
SO we have one root λ=−1 with the 3rd multiplicity.
So the solution of the relation is
an=(−1)n(c1+c2n+c3n2)
Substituting initial conditions we get:
a0=c1=1a1=−1(c1+c2+c3)=−2a2=c1+2c2+4c3=−1
Substituting c1=1 into the 2nd and 3rd equations we get:
c2+c3=1c2+2c3=−1
Solving this system we get:
c1=1c2=3c3=−2
Thus the solution of the recurrence relation is
an=(−1)n(1+3n−2n2)