已知函数f(n)=n^2(当n为奇数时)或-n^2(当n为偶数时)且an=f(n)+f(n+1),则数列{an}的前n项和S2012等于
问题描述:
已知函数f(n)=n^2(当n为奇数时)或-n^2(当n为偶数时)且an=f(n)+f(n+1),则数列{an}的前n项和S2012等于
答
当n=2k-1时,f(n)=n^2即f(2k-1)=(2k-1)^2当n=2k时,f(n)=-n^2即f(2k)=-(2k)^2an=f(n)+f(n+1)a(2k-1)=f(2k-1)+f(2k)=(2k-1)^2-(2k)^2=-4k+1a(2k)=f(2k)+f(2k+1)=-(2k)^2+(2k+1)^2=4k+1a(2k-1)+a(2k)=2S2012=(a1+a2)+(a3...