Patterns in Sequences I've heard in a movie that for any sequence of numbers, there is a nice formula for generating that sequence.  So, for example if I write:
1,2,1,2,3,3,1,2,3,1,2,4,...
There is a formula for generating it, though it is not an obvious one (to me).  Where as
1,1,2,3,5,8, ...
is simply the fibonacci sequence with a(n) = a(n-1) + a(n-2).  If the above is true, could you point me to some papers about it?  I understand elementary number theory and some abstract algebra.
Thanks.  I want to apply this to patterns in music.
EDIT: (How are you supposed to reply?)
Yes, finite sequences.  What I mean is for any sequence that can be given, that asks for a formula, it's usually given in finite form, with ellipses indicating that it can be continued or that there is a pattern.  And in music, you're usually dealing with finite songs.  So yes, finite.  Sorry for my lack of mathematical rigor, I've been out of the math mode for a few months.  I'll pick up the ball soon enough! :D
So, again, a formula that accounts for the finite sequence given (at least), or one that could also give the rest of the sequence (which could be anything really) - it really doesn't matter for my uses.
Thanks for the quick responses.  These stack exchanges are truly the best resources for info exchange, help, and community.
 A: The statement that any sequence of numbers has a formula is not a precise statement, but any precise version I can think of for it is false.
For instance, here's one problem.  This will only make sense if you understand different orders of infinity.  There are only countably many possible formulas (for any meaning of the word formulas).  However, there are uncountably many difference sequences of numbers.  Thus there have to be sequences of numbers that cannot be expressed by a formula.  In fact, "most" sequences of numbers cannot be expressed via a formula.
EDIT : OK, the OP wants a formula for finite sequences.  Here's one way to do it which yields a polynomial function.  Assume that the sequence is $a_1,\ldots,a_n$.  For $1 \leq i \leq n$, define a polynomial
$$f_i(x) = \frac{\prod_{j=1}^n (x-j)}{x-i}.$$
This is a polynomial -- the effect of the denominator is to cancel out the $x-i$ factor from the numerator.  The polynomial $f_i(x)$ has the property that $f_i(j) = 0$ for $j \neq i$ and $f_i(i) \neq 0$.  Now define
$$g_i(x) = \frac{1}{f_i(i)} f_i(x).$$
We thus have $g_i(j) = 0$ for $j \neq i$ and $g_i(i)=1$.  The desired function is then
$$H(x) = \sum_{i=1}^n a_i g_i(x).$$
A: In practice, one thing you can try is to look up the sequence in the OEIS.   Another possibility is to use Maple's gfun package.  Neither of those work for your example 1,2,1,2,3,3,1,2,3,1,2,4, I suspect because that's just a made-up sequence that doesn't have any particular pattern behind it.  On the other hand, perhaps these first 12 numbers just repeat, in which case there is a "simple" formula of the form $a_n = \sum_{j=0}^{11} c_j \exp( j n \pi i/6)$ for some constants $c_0, \ldots, c_{11}$.
A: Unfortunately I don't know the pattern of the sequence from movie
In general, if you interested in Pattern for Sequences you can start from here
http://en.wikipedia.org/wiki/Recurrence_relation
