The number of non-empty partitions of a set of size $n$ (same as the number of equivalence relations on the set) is given by the $n^{th}$ Bell number denoted by $B_n$. We can use Bell triangle to derive $B_n.$ Bell number $B_n$ is given by the first number in the $n^{th}$ row (starting from 0) of the Bell triangle which can be formed by the following equation.
$E(i,j) = E(i,j-1) + E(i-1,j-1), j > 1$
$E(i,1) = E(i-1,i-1) = B_n$ (last entry in the previous row)
$E(0,0) = 1$
Thus, we can form the Bell triangle as
$\begin{array}{cccccc}
1 \\
1 & 2\\
2&3&5\\
5&7&10&15 \\
15&20&27&37&52\\
52
\end{array}
$
Thus, $B_5 = 52$