First of all, the expression you wrote is confusing somehow: it is not easy to identify that the factor (a_n+1) is in the numerator or in the denominator. In TeX code, it means the factor (a_n+1) is in the numerator. Then the answer is easy as follows. Taking n=1, we get a_1=S_1=(a_1+1)/2. So a_1=1. For n>=2, we have a_n=S_n...