function output = lin_fib(n)

    if n < 2
        output = n;
    end
    
    x = 0;
    y = 1;
    for i = 2 : n
        z = x + y;
        x = y;
        y = z;
    end
    
    output = z;
end