About this blog

I feel this blog as a reflection of my thoughts to myself , and sometimes as a public diary, and the is my only friend to share my thoughts who says never a "oh no! ,you shouldn't....That is boring...."

Number sequence riddles are illposed problems

for any given finite sequence f and a given index n one can find Newtons divided differences formula
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:');
lf=length(f);
#in=input('Enter the target index:');
if(in>0)
  n=in-1;
 else
 break;
endif;
g=0;
while(length(f) && (n+length(f)>=lf))
  g=g+f(1)*nchoosek(n,lf-length(f));
  f=diff(f);
endwhile;
#disp(g)



Example:  newton([3 9 12 78 91 198], 1)
       
                   newton([3 9 12 78 91 198], 8)

కామెంట్‌లు లేవు: