f1 = 1;
f2 = 1;
f3 = 1;
n = 10;
f = sequence(n,f1,f2,f3)
function f = sequence(n,f1,f2,f3)
if n < 4
disp('Choose bigger value for n');
f = [f1 f2 f3];
return
end
f = zeros(1,n);
f(1) = f1;
f(2) = f2;
f(3) = f3;
for i = 4:n
f(i) = f(i-3)*f(i-1) - f(i-2);
end
end