The central polynomials of the infinite-dimensional unitary and nonunitary Grassmann algebras