find formula for series
so If I listed the first few digits of a sequence, is there a method to break it down and determine the general equation for the nth term of a sequence?
1, 9, 37, 100, 225, 325
Does there exist a method to determine the equation is
or even break it down as the series of
No, no, No, and no. There is NO general formula. For any finite set, there are infinitely many solutions. Just pick one!
Constant 5th Ratios, the next value is 97.9471
Constant 5th Differences, the next value is 73
I think that nasty 37 is a bit of a problem.
ok, well, maybe not a formula, but is there a popular algorithm used?
(oh, and I messed up, that was supposed to be a 36)
As TKHunny pointed out, the problem with your original question is the word "the" in "the general equation". To elaborate, it is always possible to fit a sequence of n terms to a polynomial of degree n-1. From this alone we see there are infinitely many solutions.
Originally Posted by Tclack
Besides looking at constant nth differences we can think of solving a system of n linear equations in n unknowns. This can be done by hand (it can be pretty long) or with a machine, using linear algebra or more basic techniques.
Here's a nice article on the subject: When Every Answer Is Correct: Why Sequences and Number Patterns Fail the Test, by Donald L. White (PDF)
Wow, this is exactly what I was looking for. Did you come up with it on your own or is it a standard method?
I've tried this. and it works for polynomials. It doesn't work so well if I write a bunch random numbers down, I'll either get a few constants in a row and then some different numbers, or I'll get Negative differences between terms, but I'll try some more
I'm going to try to see if you can do it with powers to the x too
I really appreciate your efforts in doing all of that too; it must have taken some time
By far the best method is to plug your sequence into the amazing Online Encyclopedia of Integer Sequences. If you do this with the sequence 1, 9, 37, 100, 225, 325, it will tell you that it does not recognise that sequence. If you replace the 37 with 36 it still won't recognise it. But if you also correct the 325 to 441 it will give you several possible sequences to choose from, with loads of information about each of them.
Originally Posted by Tclack
Given a set of n numbers, there exist a unique n-1 degree polynomial that takes on those values for n=1, 2, ... One way of finding that polynomial is to write out the general form for an n-1 degree polynomial, put in the values of and the given values, and solve for the coefficients.
For example, if the list of numbers given is "1, 5, 3, 2" then I know there exist a third degree (cubic) polynomial taking on those values: p(1)= 1, p(2)= 5, p(3)= 3, p(4)= 2. Any cubic polynomial can be written as . In order to take on those values, we must have:
You can solve those four equations for a, b, c, and d.
Another way of producing the same polynomial is "Newtons difference method"
If we have a series of numbers and want a polynomial such that p(0)= a, p(1)= b, p(2)= c, p(3)= d, etc., we can look at their "differences", "second differences", "third differences", etc. until we get a constant (or, if there is a finite set of numbers, we run out of numbers to subtract) and develop the polynomial from that. Using " " to mean the "first difference", b- a, c- b, d- c, etc., " " to mean the "second difference", , etc. we can write the polynomial as . Notice the similarity to the Taylor's series at x=0.
Notice that we have to start with n= 0, not n= 1. That is easily take care of- just subtract 1 from each n to start with, then after you have the formula, replace n with n+1.
Using the sequence above, p(1)= 1, p(2)= 5, p(3)= 3, p(4)= 2, we think of it as p(0)= 1, p(1)= 5, p(2)= 3, p(3)= 1. Then the "first differences" are , , and . The "second differences" are and . The "third difference" is .
Notice that there are 4 given values so 3 "first differences", 2 "second differences", 1 "third difference", and no higher differences. Putting those into the formula above will give a cubic equation. In general, if you start with "n" numbers, you will have differences up to the "n-1" difference giving a n-1 degree polynomial.
Our formula becomes .
You should be able to show that these two formulas give the same polynomial.
Of course, there is no guarentee that this polynomial will give the next number in the sequence! As several people have told you, unless you have specific information about the "form" of the sequence, knowing any number of terms tells you nothing about what the very next term will be, much less all remaining terms.
This language has the same problem as the original question. "THE" procedure does NOT exist. That is the way one person approaches such useless problems. There are many, many other ways. Just refuse to use the language that indicates there is only one procedure and only one answer. One day, perhaps in the lifetime of my grandchildren, this sort of silliness will have passed away into oblivion.
Originally Posted by Soroban
With sequences (unless there's limiting conditions), you can have more than one formula or method that would cover the sequence.