To find the sum of an arithmetic sequence, use the formula S_n=(n(a_1+a_n))/2 where S_n is the sum of n terms, a_1 is the first term in the sequence, and a_n is the nth term.
In this example, a_1=34 and a_n=2. Notice that we don't have a value for n.
To find n, use the formula for an arithmetic sequence a_n=a_1+(n-1)d where d is the common difference between the terms (found by subtracting a previous term from a term).
In this example, d=30-34=-4
To find n, plug in a_n=2, a_1=34 and d=-4 into a_n=a_1+(n-1)d
2=34+(n-1)(-4)
2=34-4n+4
-36=-4n
n=9
Now, plug n=9, a_1=34 and a_n=2 into S_n=(n(a_1+a_n))/2
S_n=(9(34+2))/2=162