\(S=1+\frac{1}{3}+\frac{1}{3^2}+........+\frac{1}{3^n}\)
\(3S=3+1+\frac{1}{3}+.......+\frac{1}{3^{n-1}}\)
\(\Rightarrow3S-S=\left(3+1+\frac{1}{3}+......+\frac{1}{3^{n-1}}\right)-\left(1+\frac{1}{3}+\frac{1}{3^2}+......+\frac{1}{3^n}\right)\)
\(\Rightarrow2S=3-\frac{1}{3^n}\Rightarrow2S=\frac{3^{n+1}-1}{3^n}\Rightarrow S=\frac{3^{n+1}-1}{2.3^n}\)