Last time we talked about 2ā[1] and demonstrated how to calculate the approximate value of 2ā. So what if we want to calculate the square root nā of any positive integer n?
When calculating 2ā, there was a key recursive formula:
2ā=1+1+2ā1ā
Careful observation will reveal that 2ā is divided into an integer part 1 and a fractional part 1+2ā1ā.
If we represent the square root nā of any positive integer n as both an integer and a fractional part[2]:
nā=ānāā+{nā}ā
How can we construct such an equation for nā and then recursively substitute it to calculate? We can use the difference of squares formula[3] to assist us:
For a specific n, although we do not yet know the approximate value of nā, ānāā can be determined[4]. Use your preferred method to solve for ānāā.
Solution
Let's try to solve 19ā. It is easy to find that ā19āā=4. Substituting into formula (1),
Here are brief answers to some of the questions mentioned in the previous article. If there are any inaccuracies, please bear with me.
Why can an equation be substituted into itself? Is this method correct?
Replacing an equation into itself is essentially the definition of recursion.
For other square root numbers, like 3ā, how can we construct an equation that is similar to the equation for calculating 2ā?
This article is the answer.
The form of the continued fraction seems similar to the iterative method for finding the greatest common divisor. What is their relationship?
The iterative method for finding the greatest common divisor essentially breaks down two numbers using smaller numbers continuously. In continued fractions, a similar mechanism operates, as shown in formulas (2) and (3).