Logarithm with negative base and negative argument in an alternating geometric sequence formula I was trying to find the number of terms "$n$" of the sequence

{$a_k$} = {$5, -1, 0.2, -0.04, ..., -0.00000256 $}, where $a_k$ = $a_1⋅r^{k-1}$ = $5⋅(-\frac{1}{5})^{k-1}$.

My problem comes up when I set $k=n$ in the previous formula to find, of course, the number of terms of the sequence $a_n$ = $5⋅(-\frac{1}{5})^{n-1}$. (Notice that $a_n$ = $-0.00000256$).


Then:

$\rightarrow$ $-0.00000256$ = $5⋅(-\frac{1}{5})^{n-1}$

$\rightarrow$ $-0.000000512$ = $(-\frac{1}{5})^{n-1}$

$\rightarrow$ $\log_{(-\frac{1}{5})} (-0.000000512)$ = $n-1$

$\rightarrow$ $n$ = $1 + \log_{(-\frac{1}{5})} (-0.000000512)$

$\rightarrow$ $n=1+9=10$
(technically)
I don't know how to get rid of negative base and negative argument. However, if they were positive the answer
will be $n$ = $10$. I don't know how that undefined logarithm came up.

So you have
$$
256 \times 10^{-8} = -5 \cdot \left( \frac{1}{-5} \right)^{n-1}.
$$
Note $256=2^8$ so this is equivalent to
$$
\begin{split}
0.2^8 (-5)^{n-1} &= -5 \\
\frac{1}{5^8} \times (-5)^{n-2} &= 1 \\
5^{n-10} \times (-1)^{n-2} &= 1
\end{split}
$$
so sounds like $n=10$.
