Let $G(n,p)$ denote the random Erdös-Rényi graph where each of the $\binom{n}{2}$ edges is present with probability $p$, such that each edge occurs independently. Then define
$$P_n = \mathbb{P}(G(n,p)\text{ is connected})$$
and note that $P_1= 1$. We now want to establish a recursive relation. For this we need to define the couple of concepts recursively.
$$\mathcal{P}_n = \{(i,x_1,\ldots,x_k):i\in\{1,\ldots,n-1\},(x_1,\ldots,x_k)\in \mathcal{P}_{n-i}\}\cup\{(n)\}$$
and $\mathcal{P}_1=\{(1)\}$, such that $\mathcal{P}_5 = \{(1,1,1,1,1),(2,1,1,1),(2,2,1),(3,1,1),(3,2),(4,1),(5)\}$, in line with what Hagen von Eitzen was stating. In this way $\mathcal{P}_n$ contains all tuples that correspond to a partition of the $n$ nodes. Then
$$1-P_n = \sum_{x\in\mathcal{P}_n\,:\,x\neq(n)} \left(M_x P_{x_1}\cdot \ldots\cdot P_{x_k} \prod_{i,j\,:\,i<j}(1-p)^{x_ix_j}\right)$$
where
$$M_x = M_{(x_1,\ldots,x_k)} = \binom{\sum_{i=1}^k x_i}{x_1,\ldots,x_k}$$
is a multinomial coefficient.