Ta có:
\(B=4+3^2+3^3+...+3^{2004}\)
\(=1+3+3^2+3^3+...+3^{2004}\)
\(\Rightarrow3B=3+3^2+3^3+...+3^{2005}\)
\(\Rightarrow3B-B=\left(3+3^2+...+3^{2005}\right)-\left(1+3^2+...+3^{2004}\right)\)
\(\Rightarrow2B=3^{2005}-1\)
\(\Rightarrow B=\frac{3^{2005}-1}{2}\)