Solution (source code)

= Solution

This is a <finite geometric series> with common ratio $r=1/\sqrt2$. Since $r^{10}=1/32$,
$$
\sum_{n=1}^{10}2^{-n/2}=\frac{r(1-r^{10})}{1-r}=\frac{31}{32}\frac1{\sqrt2-1}=\frac{31+31\sqrt2}{32}.
$$
Thus $\boxed{p=31,\ q=31}$.