This article shows how to establish expansion formulas for calculating the nested operations \((A^{\dag })^{\#}\) , \((A^{\#})^{\dag }\) , \(((A^{\dag })^{\#})^{\dag }\) , \(((A^{\#})^{\dag })^{\#}\) , \(\ldots \) of generalized inverses, where \((\cdot )^{\dag }\) denotes the Moore–Penrose inverse of a matrix and \((\cdot )^{\#}\) denotes the group inverse of a square matrix. As applications of the formulas obtained, the author constructs and classifies some groups of matrix equalities involving the above nested operations, and derives necessary and sufficient conditions for them to hold.