kill(all)$

van=facebook.com/LearningCalculus$

load(solve_rec)$

p:a+b+c$
q:a*b+b*c+c*a$
r:a*b*c$

foo: S[n+3] - p*S[n+2]+q*S[n+1]-r*S[n]=0;

solve_rec(foo,S[n],[S[0]=3,S[1]=p,S[2]=p^2-2*q]);