format long g;
format compact;
lo = 1;
hi = 1;
n = 1;
golden_ratio = (1.0 + sqrt(5.0))/2.0;
limit = 2^50 - 1;
[n lo]
while (hi <= limit)
    n = n + 1;
    ratio = hi/lo;
    [n hi ratio (ratio - golden_ratio)]
    hi = lo + hi;
    lo = hi - lo;
end

