Is there a general way of counting the number of homogeneous polynomials of certain degree in a complex projective space or a weighted complex projective space, mod the ideal generated by some homogeneous polynomials with smaller degrees?

As an example, consider the degree 18 homogeneous polynomials in $W\mathbb{P}_{[2,2,2,4]}^3$, mod the ideal generated by two degree 8 homogeneous polynomials $P_1=x^4_1$ and $P_2=x_2^4$, where $x_1$ and $x_2$ are the first and second coordinates of $W\mathbb{P}_{[2,2,2,4]}^3$. I can count the number of equivalent classes by directly listing all of such homogeneous polynomials; I would like to know if there is a more general and efficient way of doing this.

*Edit*: to avoid possible confusion, I have replaced "polynomial" by "homogeneous polynomial".