Let $X$ be an irreducible non-singular curve of genus $g$, embedded in $\mathbb{P}^n$ via the canonical embedding. 

Let $j$ be an integer, and $P\in X$ a point on the curve. I would like to prove the following statement: 

> 
> The integer $j+1$ is a Weierstrass gap for $P$ **if and only if** there
>  exists a hyperplane $H\subseteq\mathbb{P}^{n}$ such that $H$ intersects $X$
>  at $P$ with multiplicity exactly $j$.
> 
> 
> 

Recall that an integer $s$ is called a *Weierstrass gap* for a point $P\in X$ if there does **not** exist any meromorphic function $f$ on $X$ such that $f$ is regular outside of $P$, and has pole of order $s$ at $P$.

This should apparently follow from Riemann-Roch Theorem. Which line bundles should I apply the Riemann-Roch theorem on? This seems to be an important characterization of Weierstrass points, so it might be helpful to have a canonical answer in this website.