Quantum oscillations of nonlinear response in electron systems with variable density