The following text is from the book Introdução à Física Estatística (Introduction to Statistical Physics), Silvio Salinas. There's something in it that i didn't understand.
In order to highlight the role of probabilistic knowledge in defining entropy, Boltzmann proposed a model in which the particles of a gas could be found in a discrete set of energy values, {$ \epsilon_j ; j = 1,2,3... $}. The microscopic state of the Boltzmann gas is specified by supplying the energy of each of the particles. So, let's define the set of "occupation numbers", {$N_j$}, Where $N_1$ designates the number of particles with energy $\epsilon_1$, $N_2$ designates the number of particles with energy $\epsilon_2$, and so on. Therefore, given the set of occupation numbers {$N_j$}, the total energy E and the total number of particles N, we can write in the total number of microstates accessible to the system in the form $$\Omega(\{N_j\},E,N) = \frac{N!}{N_1!N_2!N_3!...} \tag1$$ with the constraints $$ N = \sum_{j} N_j \quad \text{and} \quad E=\sum_{j}\epsilon_j N_j \tag2 $$ the probability of finding the system in these conditions will be proportional to $\Omega (\{ N_j \},E,N)$, with the constraints imposed by the equations (2). So in order to find the occupation numbers in equilibrium, we can maximize $\Omega$ with respect to the set {$N_1$}. Using Lagrange multipliers method, we have the function $$ f(\{ N_j \}, \lambda_1, \lambda_2) = \log \Omega (\{ N_j \}, E, N)) + \lambda_1 (N - \sum_{j} N_j) + \lambda_2 (E - \sum_{j} \epsilon_j N_J). \tag3$$
Using Stirling's Approximation, we can also write in $$ \frac{\partial f}{\partial N_k} = - \log N_k - \lambda_1 - \lambda_2 \epsilon_k = 0 \tag4$$
Eliminating the Lagrange's multiplier $\lambda_1$, we have the equilibrium distribution $$ \frac{N_k}{N} = \frac{\exp(- \lambda_2 \epsilon_k)}{Z_1} \tag5 $$ where the normalization factor $Z_1$ is defined as $$ Z_1 \equiv \sum_{j} \exp(- \lambda_2 \epsilon_j) \tag6 $$
I didn't understand how the equation (5) was obtained, that is, how that $\lambda_1$ was eliminated in order to obtain equation (5).