Solving homogeneous, linear, constant coefficient recursion relations

Example 1

Recursion Relation:   h[[n + 3]] == 5 h[[n + 2]] - 3 h[[n + 1]] + h[[n]]
h[[0]] = 0; 
h[[1]] = 2;
h[[2]] = -1;

Clear[h, H, CharacteristicEquation, charSoln, q, x, c, ICSoln]
CharacteristicEquation=(x^3-5 x^2+3 x+1==0)
charSoln = Solve[CharacteristicEquation, x]
q = x/. charSoln

h[n_] =  genSoln[n_]  = c[1] q[[1]]^n  + c[2] q[[2]]^n  + c[3] q[[3]]^n

InitialConditions = {h[0] == 0, h[1] == 2, h[2]==-1}

ICSoln = Solve[InitialConditions, {c[1], c[2], c[3]}]

H[n_] = h[n]/. ICSoln[[1]]

Example 2

p = Expand[(x-2)^2 (x - 4)]

Recursion relation :  h[[n + 3]] ==  8 h[[n + 2]] - 20 h[[n + 1]] + 16 h[[n]]
h[[0]] = 0; 
h[[1]] = 2;
h[[2]] = -1;

Clear[h, H, CharacteristicEquation, charSoln, q, x, c]
CharacteristicEquation=(-16+20 x-8 (x^2)+(x^3)==0)
charSoln = Solve[CharacteristicEquation, x]
q = x/. charSoln

h[n_] =  genSoln[n_]  = c[1] q[[1]]^n  + c[2] n q[[2]]^n  + c[3] q[[3]]^n

InitialConditions = {h[0] == 0, h[1] == 2, h[2]==-1}

ICSoln = Solve[InitialConditions, {c[1], c[2], c[3]}]

H[n_] = h[n]/. ICSoln[[1]]