This can be generalized:
a0+a1+⋯+an=1−an+11−a
(I derived this from the formula for the finite geometric series. If I've made a mistake, please let me know.)
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 Sn=a(rn−1)r−1
But in this case n needs to be replaced with n+1 because there are n+1 terms.
Sn+1=a(rn+1−1)r−1Sn+1=1(3n+1−1)3−1Sn+1=(3n+1−1)2
You seem to have a + where there should be a -