Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I looked at Predict next number from a series and Next number in series but I did not found the answer I was looking for.

Is it possible to construct a rule for a sequence, that generates arbitrary elements?

For example $x_1, x_2, x_3, x_4$ are given and I have to find $x_5$. Can I come up with a rule which produces $x_{1-4}$ and any possible integer for $x_5$?

share|improve this question
    
This could be relevant. –  Hat Man Dec 15 at 7:18
    
You could take recursive finite differences and then extrapolate once the sequence you generate stabilizes to a constant sequence, which will happen eventually. This just duplicates polynomial extrapolation though. –  Logan Maingi Dec 15 at 7:19

3 Answers 3

up vote 1 down vote accepted

In Lagrange interpolation you can create polynomials that are $1$ at one value of $x$ and $0$ at other values. For your example, we have five of them, which will be of fourth degree. We have $p_i(j)=\delta_{ij}$, where $\delta_{ij}$ is the Kroenecker delta, $1$ if $i=j$ and $0$ otherwise. Let $y_i$ be the desired value of the sequence at $x=i$. Then $y=\sum_{i=1}^5 y_ip_i$ is the polynomial you want. There are many other functions that satisfy this. You can add any number times $(x-1)(x-2)\ldots (x-5)$. Instead of polynomials you can use trig functions.

share|improve this answer

You can generate a function which generates arbitrary $x_5$ for given $x_{1-4}$ (hint- look at polynomials of a certain degree.)

share|improve this answer

Yes, you can by taking an interpolating polynomial, through the 5 points. They are many non polynomial functions also.

For a polynomial example $f(x)=\dfrac{y_1(x-2)}{1-2}+\dfrac{y_2(x-1)}{2-1} +\lambda(x-1)(x-2)$ This takes values $y_1,y_2$ at 1 and 2 and a value depend on $\lambda$ at 3,4,etc.

We can have $f(1)=y_1,f(2)=y_2\dots$ and so on with all the other numbers taking whatever value you want. This is not generally polynomial.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.