# find an approximation of sqrt(2) via picard's iterations

2022-01-10

Since $$\sqrt{2}\approx1+\frac1{1+1+\frac1{1+1+\frac1{1+\sqrt{2}}}}$$ I thought i could do $$\frac{r_{n+1}}{s_{n+1}}=1+\frac1{1+1+\frac1{1+1+\frac1{1+\frac{r_n}{s_n}}}}$$ with the following piece of code :

ite = 8
int r = 1;
int s = 1;
int R = 0;
for (int i=0,i<ite,1){
R = 3*r+4*s;
s=2*r+3*s;
r=R
}
int result = r/s;
System.out.println(result);

But it's not exactly the code one would get using picard's iteration method, so my answer does not fit the criteria. What am-I doing wrong?

If one does not know the answer but knows how to visualise picard's method for calculating sqrt(2) on a graph that would already help me a lot.

• Questions are typically answered in as fast as 30 minutes

### Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it