Quantum magnetic oscillations of the chemical potential in superlattices and layered conductors