Hi Pizza,
This is the sum of a GP (Geometric progression) which maybe you have not learned about yet.
The first term, a=1 (3^0=1)
The common ratio r=3 (because you keep multiplying by 3)
there are n+1 terms here (see if you can understand why it is not n)
The formula for the sum of a GP is \(S_n=\frac{a(r^{n}-1)}{r-1}\)
But in this case n needs to be replaced with n+1 because there are n+1 terms.
\(S_{n+1}=\frac{a(r^{n+1}-1)}{r-1}\\ S_{n+1}=\frac{1(3^{n+1}-1)}{3-1}\\ S_{n+1}=\frac{(3^{n+1}-1)}{2}\\\)
You seem to have a + where there should be a -