等差数列前n项和为Sn=1/2(An+1/An),求通项An