1)-
S(0) =0
S(1)=3
S(2)=18
S(3)=81
S(4)=324
S(5)=1215
S(6)=4374
S(7)=15309
0, 3, 18, 81, 324, 1215, 4374, 15309, 52488, 177147, 590490, 1948617, 6377292, 20726199, ...etc.
a_n = 3^(n - 1) (n - 1) - The closed form.
2)-
t(0)=5
t(1)=9
t(2)=9
t(3)=-27
t(4)=-243
t(5)=-1215
t(6)=-5103
t(7)=-19683
5, 9, 9, -27, -243, -1215, -5103, -19683, -72171, -255879, -885735, -3011499....etc.
a_n = -3^(n - 1) (2 n - 7) - The closed form.