We study a nonlinear oscillator interacting with a one-mode cavity field. W
e assume, that the cavity is periodically kicked by a series of ultra-short
coherent pulses. We show that for a special choice of parameters the syste
m evolution is restricted to a finite set of n-photon states. In consequenc
e, the mean energy of the cavity remains finite despite the fact that the c
avity is continuously pumped. We study the properties of the cavity field s
howing that the field exhibits nonclassical features.