p, q, $"q"^2/"p", "q"^3/"p"^2$, ...

Here, a = p, r = $"q"/"p"$

Let $"q"/"p" < 1$

Sn = $("a"(1 - "r"^"n"))/(1 - "r")$, for r < 1

Sn = $("p"[1 - ("q"/"p")^"n"])/(1 - "q"/"p")$

Sn = $"p"^2/"p - q" [1 - ("q"/"p")^"n"]$

Let $"q"/"p" > 1$

Sn = $("a"("r"^"n" - 1))/("r" 1)$, for r > 1

Sn = $("p"[("q"/"p")^"n" - 1])/("q"/"p" - 1)$

= $"p"^2/"q - p"[("q"/"p")^"n" - 1]$