such that the formula satisfies f and also any arbitrary value at the n th index. That means your sequence is not going to give one single number but it can be any number for a different formula.
To check, try the following octave code:
function g=newton(f, in)
#f=input('Enter the sequence:');
#in=input('Enter the target index:');
while(length(f) && (n+length(f)>=lf))