Collective excitations of a layered electron gas in a strong magnetic field