.


           


begin

n := n + 1;

k := k*(-1);

y := 2 + k/n

end

end;

{----------------------------------------------------------------------------------------}

{ }

begin

writeln(' ');

write(' '); readln(eps);

Element_succession(eps, n, y);

writeln(' ', y:6:t(eps));

writeln(' ', n , '- ')

end.







4


Program Task4;

uses

WinCrt;

var

i, j, n : integer;

k, k1 : longint;

yn, ym, eps : real;

{----------------------------------------------------------------------------------------}

Function

t(eps : real) : integer;

var

k : integer;

begin

k := -1;

repeat

eps := eps*10;

k := k + 1

until

eps > 1;

t := k

end;

{----------------------------------------------------------------------------------------}

begin

writeln(' ');

write(' '); readln(eps);

i := 1;

yn := 1/3;

k := 2;

while

abs(yn - 1) >= eps do

begin

i := i + 1;

k := k*2;

yn := (k - 1)/(k + 1)

end;

writeln(' |yn - 1| < ', eps:1:t(eps), ' ');

writeln(' yn = ', yn:6:t(eps), ',');

writeln(' ', i); writeln;

write(' ');

write(' ', i, ' '); readln(n);

j := i; ym := yn;

k1 := k;

while

j <= n do

begin

j := j + 1;

k1 := k1*2;