program apart;Note that an error analysis is not implemented in the program. This has not much sense because the accuracy is determined by the smallest $1/2^n$ that can be represented with some significance; that is for $n\approx 52$ in double precision Pascal. The outcome is, of course, in concordance with the value already found by Lucian:
procedure again(n : integer); var a,two : double; k : integer; begin two := 1; for k := n downto 2 do two := two/2; a := 0; for k := n downto 2 do begin a := sqrt(two+a); two := two*2; end; Writeln(a); end;
begin again(52); end.
1.28573676335699E+0000Disclaimer. I certainly would have tried the closed form - whatever that means in modern times - if I only could believe that such a thing does indeed exist here.