1;

N=5;

k = [];
x = 2*pi;
for i = (0:N);
    k = [k fix(x)];
    x -= k(end);
    x = 1/x;
endfor;

k1 = k; k1(end) += 1;
a = 1;
b = k1(end); k1 = k1(1:end-1);
while(length(k1) != 0);
    tmp = b; b = a; a = tmp;
    b += a*k1(end); k1 = k1(1:end-1);
endwhile;
trihi = b/a;

k1 = k; k1(end) -= 1;
a = 1;
b = k1(end); k1 = k1(1:end-1);
while(length(k1) != 0);
    tmp = b; b = a; a = tmp;
    b += a*k1(end); k1 = k1(1:end-1);
endwhile;
trilo = b/a;

k1 = k;
a = 1;
b = k1(end); k1 = k1(1:end-1);
while(length(k1) != 0);
    tmp = b; b = a; a = tmp;
    b += a*k1(end); k1 = k1(1:end-1);
endwhile;
trial = b/a;

