The geometric progression has the form:
[tex]\mleft\lbrace a,ar,ar^2,ar^3,\ldots,ar^n\mright\rbrace[/tex]We have the information about the second term, a*r:
[tex]ar=\frac{1}{2}[/tex]We know that the common ratio is
[tex]r=\frac{1}{4}[/tex]So from this information we can get the coefficient a:
[tex]\begin{gathered} ar=\frac{1}{2} \\ a\cdot\frac{1}{4}=\frac{1}{2} \\ a=\frac{4}{2}=2 \end{gathered}[/tex]And we also know that the last term is 1/128, that is
[tex]ar^n=\frac{1}{128}[/tex]From this one we can find n:
[tex]\begin{gathered} 2\cdot(\frac{1}{4})^n=\frac{1}{128} \\ (\frac{1}{4})^n=\frac{1}{128\cdot2} \end{gathered}[/tex]We can apply the property of the logarithm of power to get n:
[tex]\begin{gathered} \log ((\frac{1}{4})^n)=\log (\frac{1}{256}) \\ n\cdot\log (\frac{1}{4})^{}=\log (\frac{1}{256}) \\ n=\frac{\log (\frac{1}{256})}{\log (\frac{1}{4})} \\ n=4 \end{gathered}[/tex]Be careful, because n is not the number of terms. The number of terms is n+1, so the G.P. has 5 terms