The $x$ is just a placeholder (an indeterminate symbol) so that any power $x^n$ can serve as point of attachment of a separate coefficient $c_n$ to form an infinite object (a formal power series) that encompasses the information about all the $c_n$ at once. In your expression $x^n$ is used to attached the number $P(n)\in\Bbb N$ of partitions of $n$ to.
In calculations one needs to restrict to a finite initial portion of the sequence for practical reasons. They can be stored in an array that is indexed starting from $0$ (for the coefficient of $x^0$). One of the most basic operations used in this context is division by a binomial $1-x^k$ with $k>0$; this turns out to be implemented easily as a modification of such an array, by a loop over all indices $i$ in increasing order (except for the last few where the operation would overflow the finite array), on iteration $i$ adding $c_i$ to $c_{i+k}$ (note that if $i\geq k$, then $c_i$ has at this point already been changed in an earlier iteration). The infinite product would in practice be truncated to a finite product (since as soon as $k$ exceeds the size of the array there is nothing that can be done in the iteration), in and outer loop on $k$ that encloses the mentioned (inner) loop on $i$. In your example the outer loop would be run for $k=1,2,3,4,\ldots$, but for other problems a different set of values for $k$ might be employed; see for instance how it is done in this answer to a different question. Note by the way that while the order for the outer loop is not essential (multiplication of power series is commutative), the order in the inner loop must be respected to implement division by $1-x^k$ (in the opposite order it would perform multiplication by $1+x^k$).
This gives a fairly fast way to compute numbers of partitions (if your computer can handle the large integers that fairly soon are needed), but it is not the best: the best known way (as far as I am aware) is to simplify the product of the denominators $1-x^k$ first, using Euler's pentagonal theorem. But that is a matter for a different question.
However, with the theory of partition numbers and $q$-series, you can find some good recurrence formula on partition numbers, like $p(n) = \sum_{0<\omega_j \le n} (-1)^{j+1} p(n-\omega_j)$ where $\omega_j = j(3j+1)/2$ for $j\in \mathbb{Z}$, which helps to find the partition numbers.
– dust05 Aug 09 '21 at 03:41