设数列{an}的首项为1,前n项之和Sn与通项an满足2Sn^2=2anSn-an,求数列{an}的通项公shi