✔ 最佳答案
C(n)=Σ_{x=1~n-3} Σ_{y=x+3~n} {[(x+y-1)/2]-x}
= Σ_{x=1~n-3} Σ_{j=2~n-x-1} [j/2] by j = y-x-1
= Σ_{i=2~n-2} Σ_{j=2~i} [j/2] by i = n-x-1
= Σ_{j=2~n-2} Σ_{i=j~n-2} [j/2] 變更加總順序(2≦j≦i≦n-2)
= Σ_{j=2~n-2} (n-j-1)[j/2]
= Σ_{j=2~n-2, j even, say j=2t} (n-j-1)[j/2]
+ Σ_{j=2~n-2, j odd, say j=2t+1} (n-j-1)[j/2]
= Σ_{t = 1~[(n-2)/2]} (n-2t-1)t
+ Σ_{t=1~[(n-3)/2]} (n-2t-2)t
= Σ_{t = 1~[(n-2)/2]} {(n-1)t-2t^2}
+ Σ_{t=1~[(n-3)/2]} {(n-2)t-2t^2}
= (n-1)[(n-2)/2][n/2]/2 - [(n-2)/2][n/2](2[(n-2)/2]+1)/3
+ (n-2)[(n-3)/2][(n-1)/2]/2
- [(n-3)/2][(n-1)/2](2[(n-3)/2]+1)/3
n even:
C(n) = {(n-1)(n-2)n/8 - (n-2)n((n-2)+1)/12}
+ {(n-2)(n-4)(n-2)/8 - (n-4)(n-2)((n-4)+1)/12}
, = n(n-2){(n-1)/8 - (n-1)/12}
+ (n-2)(n-4){(n-2)/8 - (n-3)/12}
= n(n-1)(n-2)/24 + (n-2)(n-4)n/24
= n(n-2){(n-1)+(n-4)}/24
= n(n-2)(2n-5)/24
n odd:
C(n) = {(n-1)(n-3)(n-1)/8 - (n-3)(n-1)((n-3)+1)/12}
+ {(n-2)(n-3)(n-1)/8 - (n-3)(n-1)((n-3)+1)/12}
= (n-1)(n-3){(n-1)/8-(n-2)/12} + (n-1)(n-2)(n-3)/24
= (n-1)(n-3)(n+1)/24 + (n-1)(n-2)(n-3)/24
= (n-1)(n-3){(n+1)+(n-2)}/24
= (n-1)(n-3)(2n-1)/24