function res = sumToN(n)
%!! Compute $\sum_{k=1}^n k$
res = 0;
%!! Set up the accumulator
for k=1:n
   res = res + k;
   %!! Update the accumulator on each iteration
end
