The number pi (paɪ; spelled out as "pi") is a mathematical constant that is the ratio of a circle's circumference to its diameter, approximately equal to 3.14159. The number pi appears in many formulae across mathematics and physics. It is an irrational number, meaning that it cannot be expressed exactly as a ratio of two integers, although fractions such as are commonly used to approximate it. Consequently, its decimal representation never ends, nor enters a permanently repeating pattern. It is a transcendental number, meaning that it cannot be a solution of an equation involving only sums, products, powers, and integers. The transcendence of pi implies that it is impossible to solve the ancient challenge of squaring the circle with a compass and straightedge. The decimal digits of pi appear to be randomly distributed, but no proof of this conjecture has been found.
For thousands of years, mathematicians have attempted to extend their understanding of pi, sometimes by computing its value to a high degree of accuracy. Ancient civilizations, including the Egyptians and Babylonians, required fairly accurate approximations of pi for practical computations. Around 250 BC, the Greek mathematician Archimedes created an algorithm to approximate pi with arbitrary accuracy. In the 5th century AD, Chinese mathematicians approximated pi to seven digits, while Indian mathematicians made a five-digit approximation, both using geometrical techniques. The first computational formula for pi, based on infinite series, was discovered a millennium later. The earliest known use of the Greek letter π to represent the ratio of a circle's circumference to its diameter was by the Welsh mathematician William Jones in 1706.
The invention of calculus soon led to the calculation of hundreds of digits of pi, enough for all practical scientific computations. Nevertheless, in the 20th and 21st centuries, mathematicians and computer scientists have pursued new approaches that, when combined with increasing computational power, extended the decimal representation of pi to many trillions of digits.