Find a Formula for Pi

A Gregory number is a number , where is an integer or rational number. Expanding, . With , we get Leibniz's formula for , which converges too slowly. The larger is, the better the approximation.
Euler found the formulas and and others. Machin calculated to 100 decimals using .
Størmer's numbers are the positive whole numbers for which the largest prime factor of is at least . Størmer showed that every Gregory number can be expressed uniquely as integer linear combinations of Gregory numbers with Störmer number indices.
Størmer found , and we found . To find Størmer's formula, use , , , and eliminate and .
The Demonstration finds formulas for where the terms on the right have indices as large as possible. Gregory numbers are calculated for integers that are not Størmer numbers and formulas are selected according to the term of minimal index on the right side that is a Størmer number.
First, choose a formula with minimal index 1. Select the formula as the first equation. Pick out the next smallest index, say , choose a formula in which is minimal, and add that formula as a new equation; the Demonstration solves the system for , eliminating the term with the index . Now continue with the new smallest index on the right.


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


J. H. Conway and R. K. Guy, The Book of Numbers, New York: Copernicus Books/Springer, 2006 pp. 242–247.
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.

Mathematica »
The #1 tool for creating Demonstrations
and anything technical.
Wolfram|Alpha »
Explore anything with the first
computational knowledge engine.
MathWorld »
The web's most extensive
mathematics resource.
Course Assistant Apps »
An app for every course—
right in the palm of your hand.
Wolfram Blog »
Read our views on math,
science, and technology.
Computable Document Format »
The format that makes Demonstrations
(and any information) easy to share and
interact with.
STEM Initiative »
Programs & resources for
educators, schools & students.
Computerbasedmath.org »
Join the initiative for modernizing
math education.
Step-by-Step Solutions »
Walk through homework problems one step at a time, with hints to help along the way.
Wolfram Problem Generator »
Unlimited random practice problems and answers with built-in step-by-step solutions. Practice online or make a printable study sheet.
Wolfram Language »
Knowledge-based programming for everyone.
Powered by Wolfram Mathematica © 2018 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS Give us your feedback
Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX
Download or upgrade to Mathematica Player 7EX
I already have Mathematica Player or Mathematica 7+