A hierarchy of rational numbers is derived from the integers and shown to be related to naturally occurring resonances. The integers are also related to the Towers of Hanoi puzzle. Gray code is introduced as a tool to aid in understanding Towers of Hanoi and also used to predict the symbolic dynamics of the logistic equation of dynamical systems theory. The Towers of Hanoi and Gray code are both generalized to number systems base n and used to derive a probability density function for the divisibility of integers. The number system based 4 expressed in generalized Gray code is shown to be a natural framework for the representation of the 64 codons of DNA.