  We show that whenever a Hamiltonian diffeomorphism or a Reeb flow has a
finite number of periodic orbits, the mean indices of these orbits must satisfy
a resonance relation, provided that the ambient manifold meets some natural
requirements. In the case of Reeb flows, this leads to simple expressions
(purely in terms of the mean indices) for the mean Euler characteristics. These
are invariants of the underlying contact structure which are capable of
distinguishing some contact structures that are homotopic but not
diffeomorphic.
