TOPICS
Search

Wolfram's Iteration


Wolfram's iteration is an algorithm for computing the square root of a rational number 1<=r<4 using properties of the binary representation of r. The algorithm begins with (u_0,v_0)=(r,0), and then iterates

u_(n+1)={4(u_n-v_n-1) if u_n>=v_n+1; 4u_n if u_n<=v_n
(1)
v_(n+1)={2(v_n+2) if u_n>=v_n+1; 2v_n if u_n<=v_n.
(2)

Interpreted as a binary number, v_n then converges to sqrt(r).

WolframsIteration

For example, for r=2 (i.e., Pythagoras's constant), u_n is given by 2, 4, 16, 28, 28, 112, 92, 368, 28, ... (OEIS A095803), and v_n by 0, 4, 8, 20, 44, 88, 180, 360, 724, ... (OEIS A095804). The binary representation of successive terms of v_n (with the "binary" point shifted after the first term) are then

 1.00_2 
1.000_2 
1.0100_2 
1.01100_2 
1.011000_2 
1.0110100_2,
(3)

as illustrated above, which can be seen to produce increasing numbers of digits in the binary representation of sqrt(2),

 sqrt(2)=1.0110101000001001111..._2
(4)

(OEIS A004539). Interpreting the binary fractions produced at each step gives the sequence of approximations 1, 1, 5/4, 11/8, 11/8, 45/32, 45/32, 181/128, 181/128, ... (OEIS A095805 and A095806).


See also

Square Root, Square Root Algorithms

Explore with Wolfram|Alpha

References

Sloane, N. J. A. Sequences A004539, OEIS A095803, OEIS A095804, OEIS A095805, and OEIS A095806 in "The On-Line Encyclopedia of Integer Sequences."Wolfram, S. A New Kind of Science. Champaign, IL: Wolfram Media, pp. 140-141 and 913, 2002.

Referenced on Wolfram|Alpha

Wolfram's Iteration

Cite this as:

Weisstein, Eric W. "Wolfram's Iteration." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/WolframsIteration.html

Subject classifications