= Solution
For $N>2g-2$, the divisor $K_X-Np$ has negative degree, so $\ell(K_X-Np)=0$. The <Riemann-Roch theorem> gives
$$
\ell(Np)=N+1-g.
$$
Starting from $\ell(0)=1$ and using part (ii), each integer $1\leq n\leq N$ contributes one to $\ell(Np)$ exactly when it is not a gap. Therefore
$$
\ell(Np)=1+N-|G(p)\cap\{1,\ldots,N\}|.
$$
Comparison with the preceding formula gives $|G(p)\cap\{1,\ldots,N\}|=g$. Moreover every $n>N$ is a nongap because the Riemann--Roch formula makes every subsequent dimension jump equal to one. Thus the <Weierstrass gap theorem> says
$$
\boxed{|G(p)|=g.}
$$
Back to article page