For any z_n, S(x) = 0 implies z^4 = z^3 + z^2 + 1. This also implies z^5 = z^4 + z^3 + z and z^6 = z^5 + z^4 + z^2.
Substitute these into R(x) to get R(z) = z^6 - z^5 - z^3 - z^2 - z = z^4 - z^3 - z = z^2 - z + 1.
Then the sum sought R(z_1) + R(z_2) + R(z_3) + R(z_4) = (z_1^2 + z_2^2 + z_3^2 + z_4^2) - (z_1 + z_2 + z_3 + z_4) + 4
From S(x), the sum z_1 + z_2 + z_3 + z_4 = 1 and z_1*z_2 + z_2*z_3 + z_3*z_4 + z_1*z_3 + z_2*z_4 + z_1*z_4 = -1
Then the identity (z_1 + z_2 + z_3 + z_4)^2 = (z_1^2 + z_2^2 + z_3^2 + z_4^2) + 2*(z_1*z_2 + z_2*z_3 + z_3*z_4 + z_1*z_3 + z_2*z_4 + z_1*z_4) means that z_1^2 + z_2^2 + z_3^2 + z_4^2 = 3
Then R(z_1) + R(z_2) + R(z_3) + R(z_4) = 1^2 - 3 + 4 = 2