1. 鍦∕ATLAB涓,symsum鍛戒護濡備綍浣跨敤錛
鍦∕ATLAB涓錛宻ymsum鏄奼傚拰鍛戒護銆
浣跨敤渚嬪瓙錛
syms k n
symsum(k) % k^2/2 - k/2
symsum(k,0,n-1) % (n*(n - 1))/2
symsum(k,0,n) %(n*(n + 1))/2
simplify(symsum(k^2,0,n)) %n^3/3 + n^2/2 + n/6
symsum(k^2,0,10) %385
symsum(k^2,[0,10]) %385
symsum(k^2,11,10) % 0
symsum(1/k^2) %-psi(k, 1)
symsum(1/k^2,1,Inf) % pi^2/6