Why is $\dim_k(k[X,Y]/I^n)=\frac{n(n+1)}{2}$? Let $k$ be an algebraicly closed field and $I = (X,Y)$
Why is
$$\dim_k(k[X,Y]/I^n)=\frac{n(n+1)}{2}$$
This is part of a proof in my algebraic geometry course but it isn't worked out (just used), and it doesn't seem obvious to me. Is there some trick I'm missing?
 A: Consider the special case $n = 2$: $I^2$ is generated by $XY, X^2, Y^2$ and contains all monomials $X^iY^j$ where $i + j \geq 2$.  It is easy to see that the images of $1, X, Y$ form a basis for $k[X,Y]/I^2$.
In the general case, $I^n$ is generated by all products $X^iY^{n-i}$ for $0 \leq i \leq n$, and contains all monomials $X^iY^j$ where $i + j \geq n$.  Any polynomial in $k[X,Y]$ is a finite sum, as 
$$\sum\limits_{i,j \geq 0} a_{ij}X^iY^j$$
Modulo $I^n$, you are just left with 
$$\sum\limits_{i,j} a_{ij}X^iY^j$$
where the sum only runs over those pairs $(i,j) \geq (0,0)$ such that $i + j < n$.  You conclude that those $X^iY^j$ for $i + j < n$ form a basis for $k[X,Y]/I^n$.
To count the number of elements in this basis, note that for each $0 \leq k \leq n-1$, there are exactly $k+1$ pairs of numbers $(i,j) \geq (0,0)$ such that $i + j = k$.  You can conclude that the dimension of $k[X,Y]/I^n$ is 
$$1 + 2 + \cdots + n = \frac{n(n+1)}{2}$$
A: Write $k[X,Y] = \bigoplus_d R_d$ where $R_d$ is spanned by all the monomials of total degree $d$. For example $R_2 = \operatorname{span}\{X^2, XY, Y^2\}$.
Then
$$ k[X,Y]/(X,Y)^n = \bigoplus_{d = 0}^{n - 1} R_d/(X,Y)^n. $$
That is, $k[X,Y]/(X,Y)^n$ consists only of terms with total degree $< n$. These terms are linearly independent since the only relations are on the terms of degree $n$.
Therefore
\begin{align}
\dim_k k[X,Y]/(X,Y)^n &= \sum_{d = 0}^{n - 1} \dim_k R_d/(X,Y)^n \\
&= \sum_{d = 0}^{n - 1} \dim_k R_d \\
&= \sum_{d = 0}^{n - 1} \binom{2 + d - 1}{2-1} \\
&= \sum_{d = 0}^{n - 1} (1 + d) \\
&= \sum_{d = 1}^{n} d \\
&= \frac{n(n + 1)}{2}.
\end{align}
