\(S=3+3^2+3^3+3^4+...+3^{30}\\ \Rightarrow S=\left(3+3^2+3^3\right)+\left(3^4+3^5+3^6\right)+...+\left(3^{28}+3^{29}+3^{30}\right)\\ \Rightarrow S=\left(3+3^2+3^3\right)+3^3\left(3+3^2+3^3\right)+...+3^{27}\left(3+3^2+3^3\right)\\ \Rightarrow S=\left(3+3^2+3^3\right)\left(1+3^3+...+3^{27}\right)\\ \Rightarrow S=39\left(1+3^3+...+3^{27}\right)⋮39\)
\(S=3\left(1+3+3^2\right)+...+3^{28}\left(1+3+3^2\right)\)
\(=3\left(1+3+3^2\right)\left(1+...+3^{27}\right)\)
\(=39\left(1+..+3^{27}\right)⋮39\)