∵ Sn = 1² - 2² + 3² - 4² + … + (-1)^(n-1)·n²
∴ 当n是奇数时:
Sn = 1² - 2² + 3² - 4² + 5² - 6² + 7² - …… + n²
= [1²+2²+3²+4²+5²+ … + n²] - 2×[2²+4²+6²+8²+…+(n-1)²]
= n(n+1)(2n+1)/6 - 8×[1²+2²+3²+4²+…+((n-1)/2)²]
= n(n+1)(2n+1)/6 - 8×[(n-1)/2]×[(n-1)/2 + 1]×[(n-1) + 1]/6
= n(n+1)(2n+1)/6 - 2×(n-1)(n+1)n/6
= [n(n+1)/6]×[(2n+1) - 2×(n-1)]
= [n(n+1)/6]×[1 + 2]
= n(n+1)/2
∴ 当n是偶数时:
Sn = 1² - 2² + 3² - 4² + 5² - 6² + 7² - …… - n²
= [1²+2²+3²+4²+5²+ … + n²] - 2×[2²+4²+6²+8²+…+n²]
= n(n+1)(2n+1)/6 - 8×[1²+2²+3²+4²+…+(n/2)²]
= n(n+1)(2n+1)/6 - 8×[n/2]×[n/2 + 1]×[n + 1]/6
= n(n+1)(2n+1)/6 - 2×n(n+2)(n+1)/6
= [n(n+1)/6]×[(2n+1) - 2×(n+2)]
= [n(n+1)/6]×[1 - 4]
= -n(n+1)/2
两式合并,得:
1² - 2² + 3² - 4² + 5² - 6² + 7² - …… + n²
= [(-1)^(n+1)]×n(n+1)/2
说明:
运用了公式 1²+2²+3²+4²+5²+6²+7²+ …… + n²= n(n+1)(2n+1)/6