Explanation:
According to Geometric Progression :

a(nth) = nth term of the G.P.
a(nth) = nth term of the G.P. a1 = 1st term of G.P.
a(nth) = nth term of the G.P. a1 = 1st term of G.P. r = common ratio
a(nth) = nth term of the G.P. a1 = 1st term of G.P. r = common ration = terms in the G.P.
Now,


The G.P. Is 3, 6, 12, 24.
Thus, p = 6 and q = 12