Suppose we want to find summation formula for a sequence. The easiest one would be
x1 = 1; x2 = 2; ... ; xn = n; ...
We all know the sum of the first n items is (n+1)n/2.
My question is how to find the last formula using symbolic calculation with Sympy or matlab or any other software. The difficulty I have is how to deal with n. For example, if each entry in a sequence can be written as a function of n, such as, an = n^2, where n=1, 2, ... Now how do I use symbolic calculation to get a formula for a1+a2+...+an, please? Note I want a formula in terms of a general n without specify a value for n. Is this even possible? If so, how? Thank you!