| For anyone wondering how they got the approximation sqrt(2)=1+24/60+51/60^2+10/60^3. It's based on the simple idea that: Z = (a + b)^2 = (a^2 + (2a+b)*b)
=> (2a+b)* b < Z-a^2
Given an initial estimate "a", we need to find the largest "b" such that the term on the left is less than the term on the right. Therefore our estimate will always be slightly less than the actual answer and we can repeat the process to get slightly closer.For the first iteration, Z=2 and a=1. We choose b=x/60: (2+x/60)*x/60 < 2-1^2
120x + x^2 < 3600
x = 24 ... 3456 < 3600
x = 25 ... 3625 > 3600
So our first term is 24/60.Repeat with a=1+24/60 and b=x/60^2: (2(1+24/60)+x/60^2)*x/60^2< 2-(1+24/60)^2
10080x+x^2 < 518_400
x = 51 ... 516_681 < 518_400
x = 52 ... 526_864 > 518_400
Repeat multiple times.Writing this in code I can easily get:
1;24,51,10,7,46,6,4,44,50,28 = 1.4142135623730951 This whole process can be codified into the long division algorithm for square roots which works quite neatly with base 10. Edit: formatting |