设an=a1+(n-1)d
有Sn=na1+n(n-1)d/2
limSn/(n^2+1)
=lim[na1+n(n-1)d/2]/(n^2+1)
=lim[a1/n+d/2-d/(2n)]/(1+/n^20)
=[0+d/2-0]/(1+0)
=d/2
所以d/2=-a1/8,d=-a1/4
an=a1+(n-1)d=a1-(n-1)a1/4
显然将所有的正数或非负数相加可得最大值,如果再加负数,则会减小,所以
an=a1-(n-1)a1/4≥0
因为a1>0,所以1-(n-1)/4≥0
n≤5,
n=5时,a5=0
所以Sn达到最大值时的n=4,或n=5.