1

I know how to find a non-recursive formula for a recursively defined sequence. However, now I have this puzzle which gives me a sequence (but not the recursive definition) and challenges me to find the next item. What are basic steps I can take to try to find a recursive definition of some beginning of a sequence?

For example, we could've been given the beginning of a sequence $a_0,a_1,a_2,\ldots=1, 4, 9, 16, \dots$ and the challenge being to find the next item, for example, $a_4=25$. This sequence could be recursively defined as

$$a_n = \begin{cases}1&\text{if $n=0$}\\a_{n-1}+2n-1&\text{if $n>0$}\end{cases}$$

or in closed form as $a_n=(n+1)^2$.

However, say we don't see a logic behind the sequence. Is there a way we can find any of the two forms for the sequence (either recursive or closed-form) by clever guessing, or applying some trick, assuming such a form exists?

Note: I intentionally didn't mention the sequence in my puzzle; it would be cheating, and I want to do it myself.

  • 2
    Polynomial interpolation is a way to compute a meaningful "next term" for any finite sequence. In general, there isn't a single "logic" behind a finite sequence. For example, $3,4,7,9,8,3,\ldots$ are the first digits of my cell phone. The question is not well-posed. – Jack D'Aurizio Dec 16 '14 at 22:17
  • @JackD'Aurizio you're right, I added 'assuming such a form exists' and changed 'the logic' into 'a logic'. Of course, some sequences could not be solved (or the algorithm, if one exists, could yield an incorrect result). –  Dec 16 '14 at 22:21
  • 2
    What you are given is not the sequence though. It is just a finite part of the sequence, but in order to know “the sequence”, you must be given its construction method. See https://www.youtube.com/watch?v=vKA4w2O61Xo. When given a finite part of the series, there are (possibly) almost infinite ways of constructing something that it fits into. – Lukas Juhrich Dec 16 '14 at 22:23
  • @LukasJuhrich you're also right, I changed the question with things like 'given the beginning of a sequence...'. That there may be more ways of something valid - does it need to be a problem? For example, we could prefer linear formulas over polynomials, and start by trying if a linear formula works first. I mean, that's the kind of thing I'm thinking about now. Would such a scheme be possible? –  Dec 16 '14 at 22:29
  • I get your point, but it gets rather difficult because when not defining explicitly what you are looking for, the answers might tend to be not that well-defined either, which would be a pity for some people (like me) and would make things unclear ;) – Lukas Juhrich Dec 16 '14 at 22:33
  • @LukasJuhrich I see the problem. Can you think of a way to define that nicely? I got to this idea because that's what we're doing when we try to find one solution for an inhomogeneous recursive sequence: we start trying something with exponent 1, then 2, 3, etc. Anyway, if we can't reword the question I think it's best deleted, right? Now that I think of it, it could get quite complicated indeed. –  Dec 16 '14 at 22:36
  • I don't know at the first glance, but I do not think this is a reason to delete your question. – Lukas Juhrich Dec 16 '14 at 22:38

1 Answers1

2

As mentioned in the comments, there is no way to find a defining formula for a infinite sequence from a finite initial segment because given any finite list there are infinitely many ways to extend it.

That said, if you know ahead of time that the mystery sequence is defined by some recurrence and you know something about the structure of that recurrence, you can discover its formula.

For example: Given $a_0=1, a_1=4, a_2=9, a_3=16, \dots$ and the knowledge that our recurrence is a of the form $a_{n}=ba_{n-1}+cn+d$, we get that:

$$4=b(1)+c(0)+d, 9=b(4)+c(1)+d, \mbox{ and } 16=b(9)+c(2)+d$$

Thus $b+d=4$, $4b+c+d=9$, $9b+2c+d=16$.

Solving this (linear) system yields $b=1$, $c=2$, and $d=-1$. So that $a_n = a_{n-1}+2n-1$.

This is essentially the same process as polynomial curve fitting.

The main problem with all of this is knowing what your formula should look like to begin with. Without making some assumption about the shape of your formula, solving such a problem is hopeless (because the problem is ill defined).

Bill Cook
  • 29,244