Answer
$a_n=6 (-4)^{n-1}$
Work Step by Step
The nth term is given by $a_n= a_1 r^{n-1}$ ...(1)
Here, we have $a_2=a_1 r$
and $a_5=a_1 r^{5-1} \implies a_5=a_1 r^4$
$\dfrac{a_5}{a_2}=\dfrac{a_1r^4}{a_1r}$
This gives: $r^3=-\sqrt {64} \implies r=-4$
Now, $a_2=a_1 r \implies a_1= \dfrac{-24}{-4}=6$
Hence, $a_n=6 (-4)^{n-1}$