Given the first n terms and Sn = 3 (3 ^ n + 1) / 2 of the sequence, find its general term formula

Given the first n terms and Sn = 3 (3 ^ n + 1) / 2 of the sequence, find its general term formula

Sn=3(3^n+1)/2=[3^(n+1)+3]/2 S(n-1)=(3^n+3)/2
General formula: an = SN-S (n-1) = [3 ^ (n + 1) + 3] / 2 - (3 ^ n + 3) / 2 = 3 ^ n