The Rule of 72 is based on the truncation of a Taylor Series for ln(1+x). To see how this works, let's consider the nice sum of x dollars on your bank account. Assuming a 5% annual interest, this amount has accumulated to 1.05 × M dollars after one year. After two years, the total amount is 1.05 × 1.05 × M = 1.1025 M. We can formalize this by:

     Mn = M × (1.05)n

where M is the initial amount of money, Mn is the amount after n years, and n is the number of years.

Or, in terms of an arbitrary interest rate i (in %):

     Mn = M × (1+(i/100))n

Now we want to find the number of years over which M doubles, thus Mn = 2 × M:

     2 × M  = M × (1+(i/100))n

     2 = (1+(i/100))n

     ln(2) = n × ln(1+(i/100))

Thus, the exact solution for the doubling problem is:

     n = ln(2) / ln(1+(i/100))

For example: at 2% interest, your money doubles in ln(2)/ln(1.02) = 35.00 years. Apparently the Rule of 72 is pretty close to the exact solution.

However, the exact solution is rather impractical in daily use. To simplify the equation we make use of a Taylor Series:

     ln(1+x) = x - x2/2 + x3/3 - ... 
Since x is small, we can truncate the series after the first term:
     ln(1+x) =  x

Combine this with the exact solution for the doubling problem:

     n = ln(2) / (i/100)

     n = 100*ln(2) / i

     n = 69 / i 

Thus, the Rule of 72 has a mathematical basis. The choice of the factor 72 instead of the more correct value 69 is for ease of calculation. For low values of the annual interest, the error is small.