Article 5ZKXB Harmonic e

Harmonic e

by
John
from John D. Cook on (#5ZKXB)

Douglas Hofstadter discovered that the 8th harmonic number equals e.

harmonic_e.svg

OK, not really. The following equation cannot possibly be true because the left side is rational and the right side is irrational.

However, Hofstadter showed that the equation does hold if you carry all calculations out to three decimal places.

 1.000 0.500 0.333 0.250 0.200 0.167 0.143 0.125 ----- 2.718

The following Python code gets the same result using four-place decimal arithmetic.

Here's Python code to verify it.

 >>> from decimal import * >>> getcontext().prec = 4 >>> sum(Decimal(1)/Decimal(k) for k in range(1, 9)) Decimal('2.718')
Related postsThe post Harmonic e first appeared on John D. Cook.
External Content
Source RSS or Atom Feed
Feed Location http://feeds.feedburner.com/TheEndeavour?format=xml
Feed Title John D. Cook
Feed Link https://www.johndcook.com/blog
Reply 0 comments