How to show that $\ell(D)=\deg(D)+1+\frac{(d-1)(d-2)}{2}$ for the divisor $D=\operatorname{div}(z^n)$ I'm reading the proof of Riemann–Roch theorems from those notes. In page $63$, they claims that  $\ell(D)=\deg(D)+1+\frac{(d-1)(d-2)}{2}$ for the divisor $D=\operatorname{div}(z^n)$ on a projective plane curve $F$ (which differes from $z$) of degree $d$ and uses this in the proof of Riemann Theorems. Now, I do not see why this is true.
Before stating this fact, it's asked to show that $0\rightarrow K[x,y,z]_{n-d} \rightarrow K[x,y,z]_n \rightarrow L(D)\rightarrow 0$ is exact sequence of vector spaces over $K$ where $K[x,y,z]_m$ denotes the vector space of all homogeneous polynomials in $x,y,z$ variables and the first map of the sequence is multiplication by $F$. Now, I do not understand  what is the second function. Maybe division by $z^n$? (this is the best guess I came to from the what is written above the arrow there). But regardless, even assuming the exactness of this sequence, I find trouble in concluding the required. Exactness gives that $\ell(D)=A_n-A_{n-d}$ where $A_m=\dim_K K[x,y,z]_m$. We can easily see that $A_m=C^{(m+2)}_3$ (C means choose or combinations). The problem is, in the given formula, there is a quadratic term in $d$ and I do not know degree of $\operatorname{div}(Z)$ on $F$ since it may be the case that $z$ vanishes on some point of $F$ and maybe not. .
My question is, How to prove the required relation? either via the exactness of the given sequence or by other means. If by the exactness of the given sequence, how to proceed from the point I reached?
 A: I think you're almost there:
1) As you say the last map is division by $z^n$, as explicitly stated in the problem.
2) If you're working over an algebraically closed field Bezout's theorem guarantees that the hypersurfaces $z^n=0$ and $F=0$ intersect at $n\cdot d$ points, counting multiplicities, so the intersection is never empty. Furthermore, this is exactly the degree of $D$ in $F$, i.e., $\deg D=nd$.
3) You should check your stars and bars argument to count the monomials (I personally always forget the actual formula), but I'm pretty sure that for any $m$ the space $A_m$ has $C^{m+2}_m$ monomials, which yields the desired result. 
All the previous ingredients should be enough for you to conclude!
A: You just need to find the dimension of $L(D)$ from 
\begin{equation}
0\rightarrow K[x,y,z]_{n-d} \rightarrow K[x,y,z]_n\rightarrow L(D) \rightarrow 0.
\end{equation}
This short exact sequence came from usual exact sequence of sheaves
\begin{equation}
0\rightarrow \mathcal{L}(D)\otimes \mathcal{I}_F = \mathcal{O}_{\mathbb{P}^2}(n-d) \rightarrow \mathcal{L}(D) = \mathcal{O}_{\mathbb{P}^2}(n)\rightarrow \mathcal{L}(D)|_F\rightarrow 0.
\end{equation}
Taking the chomology sequence of global section functor we get
\begin{equation}
0\rightarrow \Gamma(\mathcal{O}_{\mathbb{P}^2}(n-d))\rightarrow \Gamma(\mathcal{O}_{\mathbb{P}^2}(n))\rightarrow L(D) \rightarrow H^1(\mathbb{P}^2,\mathcal{O}_{\mathbb{P}^2}(n-d)).
\end{equation}
But we know that $H^i(\mathbb{P}^r,\mathcal{O}_{\mathbb{P}^r}(k)) = 0, 0 < i < r, \forall k \in \mathbb{Z}$ (Theorem III5.1, Hartshorne), therefore $H^1(\mathbb{P}^2,\mathcal{O}_{\mathbb{P}^2}(n-d)) = 0$.
Clearly $\dim K[x,y,z]_{n-d} = (n-d+2)(n-d+1)/2$ and $\dim K[x,y,z]_{n} = (n+2)(n+1)/2$. From the short exact sequence of vector spaces : $l(D) = \dim L(D) = \dim K[x,y,z]_{n} - \dim K[x,y,z]_{n-d} = nd + 1 - (d-1)(d-2)/2$. The degree of $D = (z^n)$ restricted to $F$ is $nd$, this follows form Bezout's theorem:
Given $r$ projective surfaces of degree $d_1,...,d_r$ on $\mathbb{P}^r_k$, $k$ algebraically closed. Then the number of intersections (degree of divisor of a curve) of all surfaces is either infinite or $d_1...d_r$. In your case the problem said $F$ is differ from $z$ therefore $\deg D|_F = nd$.
