To find $ n $ we use formula
$$ \color{blue}{S_n = a_1 \cdot \frac{1-r^n}{1-r}}$$In this example we have $ a_1 = 1 ~~,~~ r = 5 ~~,~~ S_n = 3906 $. After substituting these values to above formula, we obtain:
$$ \begin{aligned} S_n &= a_1 \cdot \frac{1-r^n}{1-r} \\[1 em] 3906 &= 1 \cdot \frac{ 1-5^n}{1 - 5} \\[1 em] 1-5^n &= \frac{ 3906}{ 1} \cdot \left(1 - 5 \right) \\[1 em] 1-5^n &= -15624 \\[1 em] 5^n &= 15625 \\[1 em] \log \left( 5^n \right) &= \log \left(15625 \right) \\[1 em] n \cdot \log \left( 5 \right) &= \log \left(15625 \right) \\[1 em] n &= 6 \end{aligned} $$The first few terms of this sequence are:
$$ 1, ~~~5, ~~~25, ~~~125 . . . $$