Let $p = \left(\sum\limits_{i=1}^{n-2} x_i^3 + x_i x_{i+1} x_{i+2}\right) + x_{n-1}^3 + x_n^3$, as a polynomial in $\mathbb{Z}[x_1, \dots, x_n]/\langle \{ x_i^5 = 0\ \forall\ i\}\rangle$. Let $t \in \mathbb{N}$. How many distinct monomials are in $p^t$?
The background here is combinatorics, where I'm counting the possible distinct results after $t$ moves, where a move is to either pick $x_i^3$, or $x_i x_{i+1} x_{i+2}$, and we can pick a variable at most 4 times. $n$ here is quite large, but $t$ is small.
Full disclosure: This is part of a programming challenge. I'm thus fine with an answer of "Check out [this theorem] about generating functions" or the like. :)