We discuss a model of a cavity filled with a passive nonlinear ‚Kerr’ medium and periodically kicked by a series of ultra-short laser pulses. The nonlinear medium is described by the (2q − 1)th nonlinearity X (2q−1). We find analytical formulas describing the field states inside the cavity. We show that such a system can produce, depending on the order of the nonlinearity, superpositions of several Fock states with the small photon numbers (0,1; 0,1,2; etc). In particular, the one-photon state can be approached during the evolution of the system with X (3) nonlinearity provided the cavity losses are negligible. The purity of states generated in this process, however, can be seriously degraded by the cavity damping. We perform numerical calculations to validate our analytical results.