MATLAB: Is symsum operator giving me this answer

beginnerseriesSymbolic Math Toolboxsymsum

I am trying to find the sum of a series that goes like 20.^-20+19.^-19+…+1.^-1 Why is the answer such a massive number and why doesn't the formatting command work?
>> syms k
>> format shorteng
>> symsum(k.^(-1.*k),1,20)
ans =

Best Answer

The Symbolic Math Toolbox has its own way of formatting numbers: the vpa function:
syms k
S = symsum(k.^(-1.*k),1,20);
S = vpa(S, 5)
S =
You can of course set the number of digits to whatever you want.
Also see the digits and double functions.