Solution (source code)

= Solution

The <symplectic group> consists of the invertible linear maps preserving the <alternating bilinear form>:
$$
\operatorname{Sp}(V)=\{g\in\operatorname{GL}(V):(vg,wg)=(v,w)\text{ for all }v,w\in V\}.
$$
We use row-vector action in this question, which is the convention compatible with its printed upper-triangular flag <stabilizer subgroup>. Thus matrices preserve a form matrix $J$ by $gJg^T=J$.

Count ordered <symplectic bases>. There are $q^{2m}-1$ choices for the first nonzero vector $e_1$. Nondegeneracy makes the equation $(e_1,f_1)=1$ a nonzero linear-functional equation, with $q^{2m-1}$ solutions. Their span is a nondegenerate plane; its <orthogonal complement> is symplectic of dimension $2m-2$. Repeating there gives
$$
\boxed{|\operatorname{Sp}_{2m}(q)|=
\prod_{i=1}^m q^{2i-1}(q^{2i}-1)=q^{m^2}\prod_{i=1}^m(q^{2i}-1).}
$$
Each <symplectic basis> is the image of a fixed one under exactly one form-preserving map, justifying the count as a group order. If $q=p^a$, every factor $q^{2i}-1$ is prime to $p$, so the exact $p$-part is $q^{m^2}$.