The nth pentagonal number, $p_n$, is made up of a square and a triangular number. In symbols we have
$p_{n}=n^{2}+\frac{n}{2}(n-1)=\frac{n}{2}(3 n-1),\quad n=0,1,2,\cdots$
This formula also makes sense if $n$ is negative, giving the so-called negative pentagonal numbers $\frac{n}{2}(3 n-1),\quad n=0,-1,-2,\cdots$ or $\frac{n}{2}(3 n+1),\quad n=0,1,2,\cdots$
Euler's pentagonal number theorem is $\prod_{n=1}^{\infty}\left(1-x^{n}\right)=\sum_{n=-\infty}^{\infty}(-1)^{n} x^{\frac{n}{2}(3 n-1)}$
For example if we expand the first two factors in the infinite product on the left-hand side, we get $(1-x)\left(1-x^{2}\right)=1-x-x^{2}+x^{3}$
The first three terms of this are the same as the first three terms of the infinite sum of the right-hand side of Euler's formula. For more details of this formula see Rademacher (1973).

arxiv(English translation of Euler's paper)
The expansion of the infinite product $(1-x)(1-x^2)(1-x^3)(1-x^4)(1-x^5)(1-x^6)…$ into a single series

1. By setting $s=(1-x)(1-x^2)(1-x^3)(1-x^4)$ …, it clearly follows that: \[ s=1-x-x^2(1-x)-x^3(1-x)(1-x^2)-x^4(1-x)(1-x^2)(1-x^3)-\textrm{ …} \] from which an infinite series will be obtained, if every term is expanded and the resulting series is then simplified for each of the powers of $x$ that are produced. Now, with the first two terms $1-x$ already expanded, in place of all the remaining terms is written the letter $A$, such that it is $s=1-x-A$, and so \[ A=x^2(1-x)+x^3(1-x)(1-x^2)+x^4(1-x)(1-x^2)(1-x^3) \textrm{ …} \]

2. Since that all these terms have the factor $1-x$ in common, by expanding each of the terms with this, we can represent the series in two parts, as such: \begin{align*} A=x^2+x^3(1-x^2)+x^4(1-x^2)(1-x^3)+x^5(1-x^2)(1-x^3)(1-x^4)+\textrm{ …}\\ -x^3-x^4(1-x^2)-x^5(1-x^2)(1-x^3)-x^6(1-x^2)(1-x^3)(1-x^4)+\textrm{ …} \end{align*} Then all the same powers of $x$ in the two parts are collected together, and this expression for $A$ follows: $ A=x^2-x^5-x^7(1-x^2)-x^9(1-x^2)(1-x^3)-x^{11}(1-x^2)(1-x^3)(1-x^4)-\textrm{ …} $ where the first two terms $x^2-x^5$ are already expanded, and the following ones procede as $x^7,x^9,x^{11},x^{13},x^{15}$, where the exponents are increasing by two.

3. Now, in a similar way as before, we put \[ A=x^2-x^5-B, \] such that it is \[ B=x^7(1-x^2)+x^9(1-x^2)(1-x^3)+x^{11}(1-x^2)(1-x^3)(1-x^4)+\textrm{ …} \] for which all the terms have the common factor $1-x^2$, so that by expanding all the terms, the series can be separated into two parts, as: \begin{align*} B=x^7+x^9(1-x^3)+x^{11}(1-x^3)(1-x^4)+x^{13}(1-x^3)(1-x^4)(1-x^5)\textrm{ …}\\ -x^9-x^{11}(1-x^3)-x^{13}(1-x^3)(1-x^4)-x^{15}(1-x^3)(1-x^4)(1-x^5)\textrm{ …} \end{align*} Here again the pairs of terms which have the same leading power of $x$ are collected into one, and it follows:$$ B=x^7-x^{12}-x^{15}(1-x^3)-x^{18}(1-x^3)(1-x^4)-x^{21}(1-x^3)(1-x^4)(1-x^5) -\textrm{ …}$$ where now the powers of $x$ are increasing by three.

4. Now, like before, it is taken $B=x^7-x^{12}-C$, so that $ C=x^{15}(1-x^3)+x^{18}(1-x^3)(1-x^4)+x^{21}(1-x^3)(1-x^4)(1-x^5)+ \textrm{ …} $ and by expanding each term with the factor $1-x^3$, it is resolved into two parts; it will be \begin{align*} C=x^{15}+x^{18}(1-x^4)+x^{21}(1-x^4)(1-x^5)+x^{24}(1-x^4)(1-x^5)(1-x^6)+ \textrm{ …}\\ -x^{18}-x^{21}(1-x^4)-x^{24}(1-x^4)(1-x^5)-x^{27}(1-x^4)(1-x^5)(1-x^6)- \textrm{ …} \end{align*} where as for the last case, contracting all of the same leading powers into one produces $ C=x^{15}-x^{22}-x^{26}(1-x^4)-x^{30}(1-x^4)(1-x^5)-x^{34}(1-x^4)(1-x^5)(1-x^6) -\textrm{ …} $ where the powers of the leading factors increase by four.

5. Then it is set $C=x^{15}-x^{22}-D$, so that it will be $ D=x^{26}(1-x^4)+x^{30}(1-x^4)(1-x^5)+x^{34}(1-x^4)(1-x^5)(1-x^6)+ \textrm{ …} $ which can be separated into two by expanding the terms by the factor $1-x^4$ in this way: \begin{align*} D=x^{26}+x^{30}(1-x^5)+x^{34}(1-x^5)(1-x^6)+x^{38}(1-x^5)(1-x^6)(1-x^7)+ \textrm{ …}\\ -x^{30}-x^{34}(1-x^5)-x^{38}(1-x^5)(1-x^6)-x^{42}(1-x^5)(1-x^6)(1-x^7)- \textrm{ …} \end{align*} At this point, to reduce this, each pair is brought together $ D=x^{26}-x^{35}-x^{40}(1-x^5)-x^{45}(1-x^5)(1-x^6)-x^{50}(1-x^5)(1-x^6)(1-x^7) -\textrm{ …} $ and here the powers of $x$ increase by five.

6. It is set $D=x^{26}-x^{35}-E$, so that it will then be $ E=x^{40}(1-x^5)+x^{45}(1-x^5)(1-x^6)+x^{50}(1-x^5)(1-x^6)(1-x^7)+\textrm{ …} $ and this is resolved into two parts, such that by doing that it follows \begin{align*} E=x^{40}+x^{45}(1-x^6)+x^{50}(1-x^6)(1-x^7)+x^{55}(1-x^6)(1-x^7)(1-x^8) +\textrm{ …}\\ -x^{45}-x^{50}(1-x^6)-x^{55}(1-x^6)(1-x^7)-x^{60}(1-x^6)(1-x^7)(1-x^8)- \textrm{ …} \end{align*} where certainly, by contracting the pairs of terms together, it comes out $ E=x^{40}-x^{51}-x^{57}(1-x^6)-x^{63}(1-x^6)(1-x^7)-x^{69}(1-x^6)(1-x^7) (1-x^8)-\textrm{ …} $ where the powers of $x$ are increasing by six.

7. By this rule, whose operations could clearly be continued further if the following values were substituted by each of the letters in the succession $A,B,C,D$, we will will obtain a series in the following form:$S=1-x,-x^2+x^5,+x^7-x^{12},-x^{15}+x^{20},+x^{26}-x^{35},-x^{40}+x^{51},+\textrm{ …}$
Thus this whole problem is reduced to a series defined such that the exponents for each $x$ are larger than the last one, and for this it is clear that the signs alternate in pairs of +'s and -'s.

8. To help us inquire further into this rule, we will look into the way that the numbers corresponding to each letter arise. Then for the first few letters, we set out their first terms, seen in this arrangement:

\begin{array}{c|cccc}A=x^2(1-x) & 7=3+4= & 3+1+3= & 3+1+1+2 \\ B=x^{7}(1-x^2) & 15= 4+11= & 4+2+9= & 4+2+2+7 \\ C=x^{15}\left(1-x^{3}\right) & 26=5+21= & 5+3+18= & 5+3+3+15 \\ D=x^{26}\left(1-x^{4}\right) & 40=6+34= & 6+4+30= & 6+4+4+26 \\ E=x^{40}\left(1-x^{5}\right) & 57=7+50= & 7+5+45= & 7+5+5+40 \\ \cdots & \cdots\end{array}

We see here for the decomposition of the letter $A$, that clearly it is made by the sum 3+4, and then that 4 is made by 1+3, and finally that 3 is made from 1+2, which gives the resolution $ 7=3+4=3+1+3=3+1+1+2. $ Moreover, this same pattern is seen in the letters following it, for which the numbers proceed next in the succession 2, 7, 15, 26, 40.

9. From this it is clear that the differences between the numbers 2, 7, 15, 26, 40, 57, … constitute an arithmetic progression, and so it follows that the general term of these numbers will be: $ 2+5(n-1)+\frac{3(n-1)(n-2)}{1\cdot 2}=\frac{3n^2+n}{2}. $ There are also numbers that come before these, which are 1, 5, 12, 22, 35, 51 for the numbers 1, 2, 3, 4, 5, for which it is seen that to make them, the number $n$ is itself taken away from the formula $\frac{3n^2+n}{2}$, so that it will be $\frac{3n^2-n}{2}$.

10. Thus we find now a single series has been made, which is equal to the given complete infinite product $ (1-x)(1-x^2)(1-x^3)(1-x^4)\textrm{ …}, $ as by using this series that has been found, it will be: $ s=1-x^1-x^2+x^5+x^7-x^{12}-x^{15}+x^{22}+x^{26}-x^{35}-x^{40}+x^{51}+ \textrm{ …} $ for which we are sure that no other powers of $x$ occur aside from those contained in this general formula $\frac{3n^2+n}{2}$, and for which if $n$ is an odd number, both terms generated by this method will have the - sign, while if it is even they will be seen to have the + sign.

Another investigation of the same series.

11. The way in which the powers of $x$ in this series procede can also be investigated by another method. Of course, $ s=1-x-x^2(1-x)-x^3(1-x)(1-x^2)-x^4(1-x)(1-x^2)(1-x^3)-\textrm{ …} $ for which by expanding the second member $-x^2(1-x)$, it will be $ s=1-x-x^2+x^3-x^3(1-x)(1-x^2)-x^4(1-x)(1-x^2)(1-x^3)-\textrm{ …} $ and it is set $s=1-x-x^2+A$ so that $ A=x^3-x^3(1-x)(1-x^2)-x^4(1-x)(1-x^2)(1-x^3)-\textrm{ …} $ for which, by expanding each term by the factor $1-x$, it is broken into two parts such that it appears as \begin{align*} A=x^3-x^3(1-x^2)-x^4(1-x^2)(1-x^3)-x^5(1-x^2)(1-x^3)(1-x^4)-\textrm{ …}\\ +x^4(1-x^2)+x^5(1-x^2)(1-x^3)+x^6(1-x^2)(1-x^3)(1-x^4)+\textrm{ …} \end{align*} Here, contracting the pairs of terms with the same powers of $x$ like before will produce this $ A=+x^5+x^7(1-x^2)+x^9(1-x^2)(1-x^3)+x^{11}(1-x^2)(1-x^3)(1-x^4)+\textrm{ …} $

12. Now again, the second term is expanded such that it follows: $ A=x^5+x^7-x^9-x^9(1-x^2)(1-x^3)+x^{11}(1-x^2)(1-x^3)(1-x^4)+\textrm{ …} $ Then it is placed $A=x^5+x^7-B$, so that it will be $ B=x^9-x^9(1-x^2)(1-x^5)-x^{11}(1-x^2)(1-x^3)(1-x^4)-\textrm{ …} $ for which if every factor $1-x^2$ is expanded, it will be obtained that \begin{align*} B=x^5-x^9(1-x^3)-x^{11}(1-x^3)(1-x^4)-x^{13}(1-x^3)(1-x^4)(1-x^5)-\textrm{ …}\\ +x^{11}(1-x^3)+x^{13}(1-x^3)(1-x^4)+x^{15}(1-x^3)(1-x^4)(1-x^5)+\textrm{ …} \end{align*} then by bringing together the pairs of terms, it will procede as $ B=x^{12}+x^{15}(1-x^3)+x^{18}(1-x^3)(1-x^4)+x^{21}(1-x^3)(1-x^4)(1-x^5) +\textrm{ …} $

13. In exactly the same way, the second term is then expanded and it is set $B=x^{12}+x^{15}-C$, and it will then be $ C=x^{18}-x^{18}(1-x^3)(1-x^4)-x^{21}(1-x^3)(1-x^4)(1-x^5)-\textrm{ …} $ Now the terms are expanded by their second factor $1-x^3$, so that it would be \begin{align*} C=x^{18}-x^{18}(1-x^4)-x^{21}(1-x^4)(1-x^5)-x^{24}(1-x^4)(1-x^5)(1-x^6) -\textrm{ …}\\ +x^{21}(1-x^4)+x^{24}(1-x^4)(1-x^5)+x^{27}(1-x^4)(1-x^5)(1-x^6)+\textrm{ …} \end{align*} Then the pairs of terms are contracted together, and it will be $ C=x^{22}+x^{26}(1-x^4)+x^{30}(1-x^4)(1-x^5)+x^{34}(1-x^4)(1-x^5)(1-x^6) +\textrm{ …} $

14. Once again, by expanding the second term and setting $C=x^{22}+x^{26}-D$, so it will be $ D=x^{30}-x^{30}(1-x^4)(1-x^5)-x^{34}(1-x^4)(1-x^5)(1-x^6)-\textrm{ …} $ which expanding with the factor $1-x^4$ will produce \begin{align*} D=x^{30}-x^{30}(1-x^5)-x^{34}(1-x^5)(1-x^6)-x^{38}(1-x^5)(1-x^6)(1-x^7)-\textrm{ …}\\ +x^{34}(1-x^5)+x^{38}(1-x^5)(1-x^6)+x^{42}(1-x^5)(1-x^6)(1-x^7)+\textrm{ …} \end{align*} Then by bringing together the pairs it will be: $ D=x^{35}+x^{40}(1-x^5)+x^{45}(1-x^5)(1-x^6)+x^{50}(1-x^5)(1-x^6)(1-x^7) +\textrm{ …} $

15. By expanding the second term with a factor, and setting $D=x^{35}+x^{40}-E$, it will be $ E=x^{45}-x^{45}(1-x^5)(1-x^6)-x^{50}(1-x^5)(1-x^6)(1-x^7)-\textrm{ …} $ and by expanding the second factors $1-x^5$ it will be \begin{align*} E=x^{45}-x^{45}(1-x^6)-x^{50}(1-x^6)(1-x^7)-x^{55}(1-x^6)(1-x^7)(1-x^8) -\textrm{ …}\\ +x^{50}(1-x^6)+x^{55}(1-x^6)(1-x^7)+x^{60}(1-x^6)(1-x^7)(1-x^8)+\textrm{ …} \end{align*} and by collecting the pairs of terms, it follows that $ E=x^{51}+x^{57}(1-x^6)+x^{63}(1-x^6)(1-x^7)+x^{69}(1-x^6)(1-x^7)(1-x^8) +\textrm{ …} $

16. Therefore, if their expressions are successively substituted for each of the letters $A,B,C,D,E$, this series will result: $ 1-x-x^2,+x^5+x^7,-x^{12}-x^{15},+x^{22}+x^{26},-x^{35}-x^{40},+\textrm{ …} $ where the series of the exponents is easily seen. Namely, as the first terms of the expressions for the letters $A,B,C,D$ are simply $x^3,x^9,x^{18},x^{30},x^{45}$, it is obvious that the exponents grow by threes, from which in general for a number $n$, the exponent will be $\frac{3n^2+3n}{2}$. In fact, it is observed that for these terms the difference between two successive powers of $x$ is the same as $n$, because of which the number $n$ will be subtracted twice from this formula, and it will be seen that the two powers being looked for appear, from which follows the exponents as $\frac{3n^2+n}{2}$ and $\frac{3n^2-n}{2}$.

17. From this it is therefore clear again that $ s=1-x-x^2+x^5+x^7-x^{12}-x^{15}+x^{22}+x^{26}-x^{35}-\textrm{ …} $ continues infinitely and has itself infinitely many factors, which of course will be $1-x,1-x^2,1-x^3,1-x^4,1-x^5,$ …, such that if it were first divided by $1-x$, then next by $1-x^2$, next by $1-x^3$, and if it continued to be divided infinitely in this way, ultimately the result would be equal to unity.

18. Then if this equation going to off infinity were given: $ 1-x-x^2+x^5+x^7-x^{12}-x^{15}+x^{22}+x^{26}-\textrm{ …}=0, $ it is possible to easily figure out all the roots. The first root will be $x=1$, then the second root will be the square of unity, then indeed the third root will be the cube of unity, then the fourth root will be the double-square of unity, and similarly in this way the fifth root will be the fifth power of unity, and thus in this way it occurs that among these unity occurs infinitely; moreover, -1 will be found whenever the root of an even power is extracted.