If [tex]a[/tex] is the first term and [tex]r[/tex] is the common ratio of the series, then the sum of the first [tex]n[/tex] terms is
[tex]S_n = a + ar + ar^2 + \cdots + ar^n[/tex]
Multiply by [tex]r[/tex] on both sides, then subtract that from and solve for [tex]S_n[/tex].
[tex]rS_n = ar + ar^2 + ar^3 + \cdots + ar^{n+1}[/tex]
[tex](1-r)S_n = a - ar^{n+1}[/tex]
[tex]S_n = \dfrac{a(1-r^{n+1})}{1-r}[/tex]
Use the given first and second terms of the sequence to find [tex]a[/tex] and [tex]r[/tex].
[tex]a = \dfrac1{64}[/tex]
[tex]ar = \dfrac1{32} \implies \dfrac r{64} = \dfrac1{32} \implies r = \dfrac{64}{32}=2[/tex]
Solve for [tex]n[/tex].
[tex]S_n = \dfrac{1-2^{n+1}}{64(1-2)} = 2^{36} - 2^{-6}[/tex]
[tex]\dfrac{2^{n+1} - 1}{2^6} = 2^{36} - 2^{-6}[/tex]
[tex]2^{n-5} - 2^{-6} = 2^{36} - 2^{-6}[/tex]
[tex]\implies n-5 = 36 \implies \boxed{n = 41}[/tex]