There are a number of theories concerning the prize's origin. The most romantic is that he was spurned by a young lady and decided to commit suicide, but was distracted by what he thought was an error in a paper by Ernst Kummer, who had detected a flaw in Augustin Cauchy's attempted proof of Fermat's famous problem. This rekindled his will to live and, in gratitude, he established the prize.
There are various theories about the origin of the prize. The most popular one is that the winner was heartbroken after being rejected by a young lady and decided to commit suicide but was persuaded to continue living by Ernst Kummer's discovery of a flaw in Augustin Cauchy's attempt at proving Fermat's problem. As a sign of gratitude, he established the prize.