Find sequence Term For set of Numbers

hi!

how we can find an sequence Term for set of numbers

1-numbers are always in order

2-if we have n numbers n/2 numbers are always present

for example we have:

Input:0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30

And Result:

Output-->2*X,x=[0..15]

i think this is very difficult whats your comment?

what computer field or algorithm can help me?

thank you :)

Re: Find sequence Term For set of Numbers

it fully depends upon what operations you permitted to use. Just arithmetic ones???

Re: Find sequence Term For set of Numbers

The general term for inferring a relationship between two variables based only one a number of observations is **regression**. For the example you listed, it can be expressed as a line equation (i.e. y = a*x + b). Linear regressions are quite simple to calculate. See https://en.wikipedia.org/wiki/Simple_linear_regression

For relationships that cannot be expressed in that format, you can try using non-linear regression. The algorithms for such regressions are approximate and not always guaranteed to find an optimal solution. Nevertheless, they can be (and are) used effectively in virtually all fields of science and engineering. In general, though, you'll need to have an idea of the functional form (and perhaps some guesses at the approximate constants) to generate high quality fits.

You can read about the issue in detail at the Wikipedia page: https://en.wikipedia.org/wiki/Regression_analysis