a and b are roots of the quadratic. Then they are also roots of the polynomial formed by multiplying the quadratic by x^n: 2x^(n+2) - 5x^(n+1) + x^n = 0. Then substituting a and b each in turn and adding the results yields 2*(a^(n+2)+b^(n+2)) - 5*(a^(n+1)+b^(n+1)) + (a^n+b^n) = 0.

Let F(n) = a^n+b^n. Then 2*F(n+2) - 5*F(n+1) + F(n). Also, S(n) given in the problem implies S(n) = F(2n). The expression to evaluate (call it E) is equivalent to (4*F(4034) + F(4030))/F(4032).

Using the F(n) equation three identities can be made

F(4034) = (5/2)*F(4033) - (1/2)*F(4032)

F(4030) = 5*F(4031) - 2*F(4032)

F(4032) = (2/5)*F(4033) + (1/5)*F(4031)

Substitute the first two identities into E to yield

E = (4*[(5/2)*F(4033) - (1/2)*F(4032)] + [F(4030) = 5*F(4031) - 2*F(4032)])/F(4032)

Which simplifies to

E = (25*[(2/5)*F(4033) + (1/5)*F(4031)] - 4*F(4032))/F(4032)

Then use the third identity to yield

E = (25*F(4032) - 4*F(4032))/F(4032) = **21**

The values 2015, 2016, 2017 are not special. Any three consecutive integers can be used (2017 -> x+1, 2016 -> x, 2015 -> x-1) and the result will still be 21.