$S = (a_1 + a_n)/2*(a_n-a_1 + 2)/2$
Sum of the elements of an arithmetic progression is $S = (a_1+a_n)*n/2$. In case you do not now what $n$ is equal to, you can use the following formula:
$S = (a_1 + a_n)/2*(a_n-a_1 + x)/x$, where $a_1$ is the first element, $a_n$ is the last element, $x$ is the "step", the number by which you increment each element of the progression in order to get its next element.