(1)当n为偶数时,an=, ∵f(x)=2x-1,g(x)=-2x,点(a2n-1,a2n)在函数y=f(x)或y=g(x)的图象上, ∴a2n=2a2n-1-1,或a2n=-2a2n-1, 当a2n=2a2n-1-1时,2a2n-1=a2n+1=n+1,∴a2n-1=, ∵数列{an} (n∈N*)的各项都为整数, ∴n为奇数时,a2n-1=, 令n=2k-1,k∈N*,则a4k-3==k,即a1,a5,a9,…,成首项为1,公差为1的等差数列; 当a2n=-2a2n-1时,a2n-1=-, 所以n为偶数时,a2n-1=-, 令n=2k′,k′∈N*,则a4k′-1=-=-k′,即a3,a7,a11,…,成首项为-1,公差为-1的等差数列; 所以S8=a1+a2+a3+a4+a5+a6+a7+a8 =(a2+a4+a6+a8)+(a1+a5)+(a3+a7) =(2+4+6+8)+(1+2)+(-1-2) =10; (2)由(1)知,n为偶数时,an=,且a1,a5,a9,…,成首项为1,公差为1的等差数列,a3,a7,a11,…,成首项为-1,公差为-1的等差数列, 所以S4n=S奇+S偶=[(1+2+3+…+n)+(-1-2-3-…-n)]+(1+2+3+4+…+2n)==2n2+n. 故答案为:(1)10;(2)2n2+n. |