The sum ${\displaystyle \sum_{k=1}^n a_k}$ can be entered in MATLAB's symbolic toolbox as symsum(a_k, 1, n).
>> syms k >> symsum(k, 1, 5) ans = 15 >> symsum( (-1)^k * k, 1, 3 ) ans = -2 >> symsum( k/(k+1), 1, 2 ) ans = 7/6 >> symsum( k^2/(k-1), 4, 5 ) ans = 139/12 >> syms n >> symsum(k, 1, n) ans = (n*(n + 1))/2 >> symsum(k^2, 1, n) ans = (n*(2*n + 1)*(n + 1))/6 >> symsum(k^3, 1, n) ans = (n^2*(n + 1)^2)/4
The sum ${\displaystyle \sum_{k=1}^n a_k}$ can be entered in a Mathematica notebook by selecting the form $\sum_{\square = \square}^\square \blacksquare$ from the Advanced tab in the Basic Math Assistant palette and filling in the blanks appropriately. Alternatively, the sum may be entered as Sum[ak, {k, n}].