Pythagoras' Constant :Ö 2
Ö2 = 1.41421356237309504880168872420969807856967187537694... 

(Click here
for a Postscript version of this page.)
There are certainly people who regard Ö2 as something
perfectly obvious but jib at Ö1. This is because they think
they can visualise the former as something in physical space but not the
latter. Actually Ö1 is a much simpler concept.
Edward Charles Titchmarsh (18991963).
1 Introduction
The constant Ö2 is famous because it's probably one of the first
irrational numbers discovered. According to the Greek philosopher Aristotle
(384322 BC), it was the Pythagoreans around 430 BC who first demonstrated the
irrationality of the diagonal of the unit square and this discover was
terrible for them because all their system was based on integers and fractions
of integers. Later, about 2300 years ago, in Book X of the impressive
Elements, Euclid (325265 BC) showed the irrationality of every
nonsquare integer (consult [7] for an introduction to early Greek
Mathematics). This number was also studied by the ancient Babylonians. The
history of the famous sign Ö goes back up to 1525 in a treatise named
Coss where the German mathematician Christoff Rudolff (14991545)
used a similar sign to represent square roots.
Definition 1
Ö 2 is the unique positive root of the polynomial equation :
Theorem 2
Ö 2 is an irrational and algebraic number.
Proof. Suppose that Ö 2=p/q where p and q are relatively primes, then
p^{2}=2q^{2} therefore p is even and p=2p^{¢} which leads to
q^{2}=2p^{¢2} and to the fact that q=2q^{¢}. This is in
contradiction with p and q being relatively primes.
We will now introduce some of the techniques available to compute this number.
2 Sequences with integers
2.1 Elementary approach
An elementary and ancient algorithm consists in using the double sequence
which verifies

p_{n+1}
q_{n+1}

= 
p_{n}/q_{n}+2
p_{n}/q_{n}+1



so that :

lim
n®¥

x_{n}= 
lim
n®¥


p_{n}
q_{n}

=Ö2. 

It is of interest to note that this quite simple recursion only uses additions
with integers and eventually a final division to convert the fraction into the
usual decimal representation. Denoting the error by e_{n}=Ö2p_{n}/q_{n}, one easily see that e_{n+1} < e_{n}/5, which involves a geometrical convergence (that is, one digit
will be added at every N iterations).
Starting with p_{0}=q_{0}=1 we obtain :
x_{3}=17/12 was used by Mesopotamians to replace Ö2. It may be
convenient to use a matrix representation of the sequence, we write the
sequence like this :

æ ç
è


ö ÷
ø

= 
æ ç
è


ö ÷
ø


æ ç
è


ö ÷
ø



so that

æ ç
è


ö ÷
ø

=A^{n} 
æ ç
è


ö ÷
ø

= 
æ ç
è


ö ÷
ø

n


æ ç
è


ö ÷
ø

. 

2.1.1 Quadratic convergence
This matrix representation may be used with n=2^{p} and thanks to the
relation (exercise : show this by recurrence) :
comes the following algorithm

ì í
î

a_{p+1}=a_{p}^{2}+2b_{p}^{2} 





starting with a_{0}=b_{0}=1. It's easy to see that this new process has a
quadratic convergence rate and its first iterates are given here :
(3,2),(17,12),(577,408),(665857,470832),(886731088897,627013566048),... 

and

ê ê

886731088897
627013566048

Ö2 
ê ê

< 10^{24}. 

Note that, in each step of this algorithm, the product of large integers is
required and this may be done very efficiently using fast multiplication
methods. This method is related to Newton's iteration by observing that :
x_{p+1}= 
a_{p+1}
b_{p+1}

= 
a_{p}^{2}+2b_{p}^{2}
2a_{p}b_{p}

= 
1
2


a_{p}
b_{p}

+ 
b_{p}
a_{p}

= 
x_{p}
2

+ 
1
x_{p}

, 

which will be derived by different means later in this essay (see section
6).
2.1.2 Cubic convergence and quintic convergence
The same approach leads to the Cubic sequence

ì í
î

a_{p+1}=a_{p}( a_{p}^{2}+6b_{p}^{2}) 

b_{p+1}=b_{p}( 3a_{p}^{2}+2b_{p}^{2}) 




starting with a_{0}=b_{0}=1 the first iterates are given by :
(7,5),(1393,985),(10812186007,7645370045),... 

and also to the Quintic sequence

ì í
î

a_{p+1}=a_{p}( a_{p}^{4}+20a_{p}^{2}b_{p}^{2}+20b_{p}^{4}) 

b_{p+1}=b_{p}( 5a_{p}^{4}+20a_{p}^{2}b_{p}^{2}+4b_{p}^{4}) 




giving the iterates
(41,29),(1855077841,1311738121),... 

We have generated algorithms of this nature at any order of convergence using
in the sequence polynomials of higher degrees.
2.2 Modification of the sequence
If we set u_{n}=p_{n}+q_{n} and v_{n}=q_{n} then the double sequence
(1) is equivalent to this new one :
and u_{n}/v_{n}=u_{n}/u_{n1}=(p_{n}+q_{n})/q_{n} converge to Ö2+1.
So starting with u_{0}=1,u_{1}=2 gives the set of u_{n}:
(1,2,5,12,29,70,169,408,985,2378,5741,13860,33461,80782,195025,470832,...) 

those numbers are sometime called Pell numbers and the sequence
u_{n }is a Pell sequence. The first 41 numbers may be found
in [10] as well as other similar sequences like Lucas
sequences used in Primality tests. For example

u_{15}
u_{14}

1= 
470832
195025

1=1.4142135623(637...) 

and it was found with very little efforts.
This method is probably due to ancient Babylonians.
2.3 Improvement of the sequence
It's possible to improve this method by using a more general sequence :

ì í
î

p_{n+1}=(A+B)p_{n}+2Aq_{n} 

q_{n+1}=2Bp_{n}+(A+B)q_{n} 




Easy manipulations show that
and that for the error
e_{n}= 
ê ê
ê

æ Ö


x_{n} 
ê ê
ê

, 

we have the bound
e_{n+1} < e_{n} 
æ ç
è

æ Ö


1 
ö ÷
ø

2

. 

The more A/B is close to 1 the more the speed of convergence is increased.
Example 3
To illustrate the method let's use the relation
which corresponds to A=50 and B=49 and the iterative system becomes :
as for the error, we have
e_{n+1} < e_{n} 
æ ç
è

æ Ö


1 
ö ÷
ø

2

< e_{n}/9604. 

Here are the first iterates :

ê ê ê ê
ê ê ê



x_{3}=1.4142135623(637...), 

x_{4}=1.41421356237309(481...) 




and almost 4 new digits are added with each step.
3 Continued fraction
3.1 Elementary continued fraction
The idea is to write Ö2=1+1/a_{1} with a_{1}=2.4142135...=2+1/a_{2} and so on... This gives the wellknown
development :
Theorem 4
(Bombelli 1572, [4]).
It is more convenient to use the notation
The development is periodic of period 1 with number {2}. It's a general
result : square roots can always be represented with a periodic continued
fraction development [5]. It's possible to show that the previous
sequence also gives the continued development of Ö2. We give the first
rational approximations :

æ è

p_{k}
q_{k}

ö ø

k=1...

= 
æ è

3
2

, 
7
5

, 
17
12

, 
41
29

, 
99
70

, 
239
169

, 
577
408

, 
1393
985

, 
3363
2378

, 
8119
5741

, 
19601
13860

, 
47321
33461

,¼ 
ö ø

. 

3.2 Other continued fractions
Faster converging continued fractions may be obtained, for example :
5Ö27=[0;14,14,14,14,...]. 

The development is periodic of period 1 with number {14}. This time, the
first rational approximations are :

æ è

p_{k}
q_{k}

ö ø

k=1...

= 
æ è

1
14

, 
14
197

, 
197
2772

, 
2772
39005

, 
39005
548842

, 
548842
7722793

, 
7722793
108667944

,¼ 
ö ø



and of course Ö2 » 7/5+p_{k}/(5q_{k}), the error is about
1/q_{k}^{2}. Observe that here p_{k}=q_{k1} which simplifies the
evaluation of the approximations.
Other fast converging continued fractions are given by
29Ö241=[0;82,82,82,82,...] 

and
169Ö2239=[0;478,478,478,478,...]. 

It's possible to find interesting continued fractions for numbers of the form
mÖ2n and it's not hard to show that if the integers m and n are
such as
(this is a nonlinear Diophantine equation and it's called a Pell's
equation) then
mÖ2n=[0;2n,2n,2n,2n,...]. 

From a fundamental result on Pell's equations the solutions are contained in
the convergents of the simple continued fraction of Ö2 (there are
exactly the convergents of even rank [5] in the case of Ö2). It's also possible to show that there are given by the sequence
starting with (1,1).
Hence the first couples (m_{k},n_{k}) are
(1,1),(5,7),(29,41),(169,239),(985,1393),(5741,8119),(33461,47321),... 

Example 5
With the couple (33461,47321) we have the approximation
33461Ö 247321 » 
1
2.47321



that is
Ö 2 » 
47321
33461

+ 
1
3166815962

=1.4142135623730950488(369...) 

(19 correct digits).
4 Infinite products
The two wellknown Infinite products for cosx and sinx are :
Theorem 6
(Euler 1748, [2])

cosx= 
æ è

1 
4x^{2}
p^{2}

ö ø


æ è

1 
4x^{2}
9p^{2}

ö ø


æ è

1 
4x^{2}
25p^{2}

ö ø

¼ 

sinx=x 
æ è

1 
x^{2}
p^{2}

ö ø


æ è

1 
x^{2}
4p^{2}

ö ø


æ è

1 
x^{2}
9p^{2}

ö ø

¼ 




Setting x=p/4 in the cosine product leads to

1
Ö2

= 
æ è

1 
1
4

ö ø


æ è

1 
1
36

ö ø


æ è

1 
1
100

ö ø

... 

therefore
Ö2= 
æ è

2.2
1.3

ö ø


æ è

6.6
5.7

ö ø


æ è

10.10
9.11

ö ø


æ è

14.14
13.15

ö ø

...= 
Õ
k ³ 0


(4k+2)^{2}
(4k+1)(4k+3)

, 
 (2) 
or, which is equivalent, to the aesthetic formula :
Ö2= 
Õ
k ³ 0


æ è

1+ 
1
4k+1

ö ø


æ è

1 
1
4k+3

ö ø

= 
æ è

1+ 
1
1

ö ø


æ è

1 
1
3

ö ø


æ è

1+ 
1
5

ö ø


æ è

1 
1
7

ö ø

... 
 (3) 
The convergence is extremely slow as we may observe with some iterates :
Euler gave the interesting product (2) in 1748 [2], and
it's very similar to John Wallis formula for p:

p
4

= 
æ è

2.4
3.3

ö ø


æ è

4.6
5.5

ö ø


æ è

6.8
7.7

ö ø


æ è

8.10
9.9

ö ø

..., 

while the product (3) can be compared to the celebrated series

p
4

=1 
1
3

+ 
1
5

 
1
7

+ 
1
9

... 

With x=p/8 in the infinite product we extract the also slow converging
infinite product
2+Ö2=4. 
æ è

3.5
4.4

ö ø

2


æ è

11.13
12.12

ö ø

2


æ è

19.21
20.20

ö ø

2


æ è

27.29
28.28

ö ø

2

... 

5 Taylor's expansions
From the Taylor expansion of (1+x)^{1/2} or (1x)^{1/2}, it's possible to
find another class of algorithms based on series computation.
Theorem 7
(Newton 1665). Let  1 < x < 1, then

 Ö

1+x

=1+ 
1
2

x 
1
2.4

x^{2}+ 
1.3
2.4.6

x^{3}¼ 

1/  Ö

1x

=1+ 
1
2

x+ 
1.3
2.4

x^{2}+ 
1.3.5
2.4.6

x^{3}+¼ 



 (4) 
This theorem was first stated by Isaac Newton (16431727) and a correct proof
appears later and is due to Leonhard Euler (17071783).
Applying the first expansion in (4) which is still valid for x=1
produces the very slowly convergent and alternating series
Ö2=1+ 
1
2

 
1
2.4

+ 
1.3
2.4.6

 
1.3.5
2.4.6.8

+..., 

which first terms are :
A nice improvement is to use the previous results on continuous fractions. We
can write :
and for each value of k, this will provide a formula where the number inside
the square root of the right hand side of the formula is near 1. When k
increases this number tends to 1. Using this remark leads to a sequence of
formulae for Ö2, which are more and more efficient :
Ö2= 
æ ç
è

3
2


æ Ö


, 
7
5


æ Ö


, 
17
12


æ Ö


, 
41
29


æ Ö


, 
99
70


æ Ö


, 
239
169


æ Ö


,¼ 
ö ÷
ø

. 

Example 8
Using this last formula jointly with Newton's series expansion gives the very
fast converging and easy to implement sequence
Ö 2= 
239
169


æ è

1+ 
1
2


1
57121

 
1
8


1
57121^{2}

+ 
3
48


1
57121^{3}

¼ 
ö ø



for which the first terms are :

ê ê ê ê
ê ê ê


x_{2}=1.414213562(427...), 

x_{3}=1.41421356237309(457...), 

x_{4}=1.41421356237309504880(687...). 




With a very little calculation we have computed 20 digits of Ö
2.
Example 9
(Euler 1755, [4], [8]). The relation Ö
2=(7/5)/Ö (49/50) produces the nice and easy to compute by hand series
expansion :
Ö 2= 
7
5


æ è

1+ 
1
100

+ 
1.3
100.200

+ 
1.3.5
100.200.300

+... 
ö ø

. 

The main advantage of using Taylor's formulae is to require only basic
multiprecision operations between numbers.
You can download a small clear C program which uses this type of
formula with a classical algorithm to compute Ö2 : see the Easy
programs for constants computation page at [3].
6
Newton's iteration
A very efficient way to compute square roots is to use the Newton
iteration [9] on the function f(x)=x^{2}2. It gives the
following sequence :
x_{n+1}=x_{n} 
f(x_{n})
f^{¢}(x_{n})

= 
1
2


æ è

x_{n}+ 
2
x_{n}

ö ø

= 
x_{n}
2

+ 
1
x_{n}

, 

x_{n+1} can also be interpreted as the simple mean between the approximation
x_{n} and 2/x_{n} which is also another approximation.
The first terms of this sequence are :

ê ê ê ê
ê ê ê




x_{4}=1.41421356237(468...). 




Number D of correct digits after n iterations with the elementary Newton
iteration :
It's a wellknown result that the rate of convergence of Newton's method and
therefore of this sequence is quadratic (the number of digits is
doubling at each iteration) for a starting point x_{0} sufficiently close to
the root of the equation.
Computing Ö2 with this algorithm is convenient if one can compute
easily the inverse of x_{n}. In fact, it is simpler to use only
multiplications. This can be reached by using a modified sequence which
converges to 1/Ö2 : it consists in using the Newton iteration but this
time with the function f(x)=1/x^{2}2, yielding the sequence
x_{0}= 
1
2

, x_{n+1}=x_{n} 
æ è

3
2

x_{n}^{2} 
ö ø

=x_{n }+x_{n} 
æ è

1
2

x_{n}^{2} 
ö ø

. 

Observe that in the right hand side relation the increment tends to zero. We
give the first iterates :

ê ê ê ê ê
ê ê ê ê





x_{5}=0.707106781186(307...), 




again the convergence is quadratic. A final multiplication by 2 will give
the value of Ö2. The advantage of this method is to avoid a
multiprecision division at each step and replace it by two multiprecision
multiplications. This algorithm is extremely efficient and may be used to
compute Ö2 up to billion's of digits.
7 Cubic iteration
7.1 Halley's iteration
Using the second derivative of f(x)=x^{2}2, it's possible to find a
sequence with cubic convergence (the number of digits is multiplied by 3 at
each step). The general formula is given by Halley's iteration (the
original form was introduced by the astronomer Edmund Halley (16561742) in
1694) :
x_{n+1}=x_{n} 
f(x_{n})
f^{¢}(x_{n})


æ è

1 
f(x_{n})f^{¢¢}(x_{n})
2f^{¢}(x_{n})^{2}

ö ø

1

. 

Applying this formula with function f(x) gives :
x_{0}=1, x_{n+1}=x_{n} 
x_{n}^{2}+6
3x_{n}^{2}+2

=x_{n} 
æ è

1+2 
(2x_{n}^{2})
3x_{n}^{2}+2

ö ø

. 

The first terms of this sequence are :

ê ê ê
ê ê



x_{3}=1.414213562373095048(795...). 




Number D of correct digits after n iterations with Halley's iteration :
7.2 Another cubic iteration
In [1], an interesting cubic iteration is given which converge to
1/ÖA
x_{n+1}= 
x_{n}
8

(1510Ax_{n}^{2}+3A^{2}x_{n}^{4}). 

It may be deduced from the general Householder's iteration [6]
x_{n+1}=x_{n} 
f(x_{n})
f^{¢}(x_{n})


æ è

1+ 
f(x_{n})f^{¢¢}(x_{n})
2f^{¢}(x_{n})^{2}

ö ø

, 

which has cubical convergence for a close enough starting point
x_{0} (observe the similarity with Halley's iteration).
By applying this general pattern for f(x)=1/x^{2}A we obtain :
x_{n+1}=x_{n}+ 
x_{n}
8

( 710Ax_{n}^{2}+3A^{2}x_{n}^{4}) = x_{n}+ 
3A^{2}x_{n}
8


æ è

x_{n}^{2} 
1
A

ö ø


æ è

x_{n}^{2} 
7
3A

ö ø

. 

If we explicit this formula with A=2, and starting with x_{0}=1/2,
x_{n+1}=x_{n}+ 
x_{n}
8

(720x_{n}^{2}+12x_{n}^{4})=x_{n}+ 
x_{n}
8

(2x_{n}^{2}1)(6x_{n}^{2}7), 

and, in this iteration, no multiprecision division is required. The first
iterates are :

ê ê ê
ê ê



x_{3}=0.7071067811(398...). 




Number D of correct digits after n iterations with Householder's cubic
algorithm :
This method may also be very efficient for high precision computation.
8 Quartic and high order iterations
The direct application of the modified iterations (see the Newton's
iteration pages at [3]) on the function
f(x)=1/x^{2}1/2 produces a set of high order algorithms. It's interesting
to note that relatively easy algorithms of any order may be derived.
In the following lines we will use the notation
8.1 Quartic iteration
The quartic modified iteration is
x_{n+1}=x_{n}+ 
x_{n}
16

( 8h_{n}+6h_{n}^{2}+5h_{n}^{3}) . 

For example, if we take the initial value x_{0}=3/2, the first two
iterations are

ê ê
ê


x_{2}=1.41421356237309(494...). 




Number D of correct digits after n iterations with the quartic algorithm :
8.2 Quintic iteration
The same method also produces the quintic (fifthorder) modified
iteration
x_{n+1}=x_{n}+ 
x_{n}
128

( 64h_{n}+h_{n}^{2}( 48+40h_{n}+35h_{n}^{2}) ) , 

and again with the initial value x_{0}=3/2, the first two iterations are :

ê ê
ê


x_{2}=1.414213562373095048801688(932...). 




Number D of correct digits after n iterations with the quintic algorithm :
Algorithms with any order of convergence may also be generated easily (for
example : sextic, septic, octic, ... iterations are available !) and we end
this section with the octic (eighthorder) iteration :

ì ï í
ï î

d_{n}=1024h_{n}+h_{n}^{2}( 768+640h_{n}+560h_{n}^{2}+h_{n}^{2}(504h_{n}+h_{n}^{2}( 462+429h_{n}) )) , 

x_{n+1}=x_{n}+ 
1
2048

x_{n}d_{n}. 




9 Double Iteration
9.1 Quadratic double iterative procedure
During the first years of computer time (EDSAC group at Cambridge University
1951), the following double sequence (easily deduced from Newton's iteration
on the inverse of the square root) was proposed to compute square roots :
and

ì ï ï í
ï ï î

x_{n+1}=x_{n} 
æ è

1 
1
2

h_{n} 
ö ø



h_{n+1}= 
1
4

h_{n}^{2}( h_{n}3) 




then the sequence h_{n} tends to 0 and the sequence x_{n} tends to
ÖA (A < 3).
Example 10
Let A=2, therefore

ê ê ê ê ê
ê ê ê ê

x_{1}=1.(000...),h_{1}=0.5 

x_{2}=1.(250...),h_{2}=0.21875... 

x_{3}=1.(386...),h_{3}=0.03850... 

x_{4}=1.41(341...),h_{4}=0.001126... 

x_{5}=1.41421(288...),h_{5}=0.000000951... 




and then the convergence becomes quadratic. The number of non quadratic cycles
is reduced when A tends to 1. For example, using relation Ö
2=7/5Ö{50/49} so that A=50/49, will lead to a quadratic converge at once.
9.2 Other rates of convergence
Small modifications in the previous procedure may increase the order of
convergence, for example the following algorithm has cubic convergence :
and

ì ï ï í
ï ï î

x_{n+1}=x_{n} 
æ è

1 
1
2

h_{n}+ 
3
8

h_{n}^{2} 
ö ø



h_{n+1}= 
1
64

h_{n}^{3}( 4015h_{n}+9h_{n}^{2}) . 




Algorithms at any order of convergence may also be generated.
References
 [1]
 J.M. Borwein and P.B. Borwein, Pi and the AGM  A study in
Analytic Number Theory and Computational Complexity, A WileyInterscience
Publication, New York, (1987)
 [2]
 L. Euler, Introduction à l'analyse infinitésimale
(french traduction by Labey), Barrois, ainé, Librairie, (original 1748,
traduction 1796), vol. 1, p. 8990
 [3]
 X. Gourdon and P. Sebah, Numbers, Constants and
Computation, Internet site at http://numbers.computation.free.fr/Constants/constants.html.
 [4]
 E. Hairer and G. Wanner, L'analyse au fil de
l'histoire, Bibliothèque Scopos, Springer, (2000)
 [5]
 G.H. Hardy and E.M. Wright, An Introduction to the Theory
of Numbers, Oxford Science Publications, (1979)
 [6]
 A.S. Householder, The Numerical Treatment of a
Single Nonlinear Equation, McGrawHill, New York, (1970)
 [7]
 V.J. Katz, A History of MathematicsAn Introduction,
AddisonWesley, (1998)
 [8]
 K. Knopp, Theory and application of infinite series,
Blackie & Son, London, (1951)
 [9]
 I. Newton, Methodus fluxionum et serierum infinitarum, (16641671)
 [10]
 P. Ribenboim, The new Book of Prime Number Records,
Springer, (1996)
Back to Numbers,
Constants and Computation
File translated from
T_{E}X
by
T_{T}H,
version 3.01.
On 15 Nov 2001, 10:43.