function X=fib(limit,x1,x2)
X(1)=x1; X(2)=x2;
n=3;
while X(n-1)<=limit,
    X(n)=2*X(n-1)-X(n-2);
    n=n+1;
end;