Question 1089104
If you calculate the differences between consecutive terms,
you find that those differences form a geometric sequence
(or geometric progression, or GP, if those are the preferred names where you live).
The terms are
{{{a[1]=1=3^0}}} ,
{{{a[2]=a[1]+3^1=1+3=4}}} ,
{{{a[3]=a[2]+3^2=4+9=13}}} ,
{{{a[4]=a[3]+3^3=13+27=40}}} .
So, {{{a[n]=1+3+3^2+3^3+"..."+3^(n-1)}}}
The differences form a geometric sequence/progression with common ratio r=3.
So, you can calculate each term as the sum of that geometric sequence/progression.
You can also figure it out from polynomial products,
knowing that {{{(x-1)*(1+x+x^2+x^3+"..."+x^(n-1))=x^n-1}}} ,
and for {{{x=3}}} you have
{{{(3-1)*(1+3+3^2+3^3+"..."+3^(n-1))=3^n-1}}} .
Either way, you end up with
{{{a[n]=sum(3^k,k=0,n-1)}}}{{{"="}}}{{{(3^n-1)/(3-1)}}}{{{"="}}}{{{(3^n-1)/2}}}
Each term is the sum of all the terms before,
The sum of you have to calculate is
{{{1+4+13+40+"..."+a[n]=sum(a[k],k=1,n)}}}{{{"="}}}
{{{sum((3^k-1)/2,k=1,n)=sum(3^k/2,k=1,n)-n/2=(1/2)sum(3^k,k=1,n)-n/2}}} .
The sum in the formula is related to the one we had calculated before:
{{{sum(3^k,k=1,n)=3+3^3+3^3+3^4"..."+3^n=3(1+3+3^2+3^3+"..."+3^(n-1))=3(3^n-1)/2}}} , so
{{{1+4+13+40+"..."+a[n]=(1/2)(3(3^n-1)/2)-n/2}}}{{{"="}}}{{{3(3^n-1)/4-n/2}}}