  An existing dialogue between number theory and dynamical systems is advanced.
A combinatorial device gives necessary and sufficient conditions for a sequence
of non-negative integers to count the periodic points in a dynamical system.
This is applied to study linear recurrence sequences which count periodic
points. Instances where the $p$-parts of an integer sequence themselves count
periodic points are studied. The Mersenne sequence provides one example, and
the denominators of the Bernoulli numbers provide another. The methods give a
dynamical interpretation of many classical congruences such as Euler-Fermat for
matrices, and suggest the same for the classical Kummer congruences satisfied
by the Bernoulli numbers.
