1
$\begingroup$

I have the following sequences:

a = [0, 1, 2, 3, 4, 5]
b = [1, 2, 4, 7, 13, 26]
c = [1, 1, 2, 4, 7, 13]

I'm trying to reverse-engineer an undocumented API and believe that the values in a can be used to determine the corresponding values in b and c. For instance, we could say that third element in b (4) is two times the value in a (2), while the corresponding value in c is the same as a's. Unfortunately that algorithm doesn't work across all the values f the sequences. Does this make sense? If so, can anyone think of any common series that would give the values of b and c?

  • 0
    This is not mathematics. Maybe it is programming.2010-10-13
  • 3
    Do the sequences extend, or they have exactly 6 terms?2010-10-13
  • 0
    http://www.research.att.com/~njas/sequences/index.html?q=1,+2,+4,+7,+13,+262010-10-13
  • 0
    @muad I'm looking for an equation. I figured this site was more appropriate than Stack Overflow.2010-10-13
  • 0
    There is a formula for this on wikipedia: http://en.wikipedia.org/wiki/Catalan_number2010-10-13
  • 1
    @muad: As is it's neither math nor CS but, rather, numerology.2010-10-13
  • 0
    @pr1001, it's not appropriate here (just for your information).2010-10-13
  • 0
    @pr1001: it would help if you could give more details about what the numbers are supposed to represent. My guess is it's one of the sequences in the OEIS link and if I knew more I could tell you which one.2010-10-13
  • 0
    @Qiaochu Yuan, the `b` and `c` sequences are dimensions of an image. Given this and the fact only `c` seems to be similar to a well-known forumla suggests that the numbers are arbitrary. Thanks for your help and for introducing me to Catalan numbers.2010-10-14

2 Answers 2

1

Unfortunately, we don't have enough information here to reverse-engineer your problem. For instance, the Generalized Catalan Numbers have been referenced in the comments (by Qiaochu Yuan) because they appear in your sequence $b.$ This sequence starts $1,1,1,2,4,7,13,26,52,104,\ldots$

However, I could define a “random” sequence by $u_1=1$ and for $n>1$ $$U_n=2U_{n-1} \quad \textrm{ for } n \equiv 0,1 \textrm{ mod } 4$$ and $$U_n=2U_{n-1}-1 \quad \textrm{ for } n \equiv 2,3 \textrm{ mod } 4.$$

This follows the stated Catalan sequence exactly, and so contains your sequence $b,$ up until we get 103 instead of 104. I give this as an illustration that with the current information this problem has no definitive answer.

EDIT: To be fair to the question asker, I'd like to point out that the fact that he/she cannot do what he/she wants to do is often not so clear to people who've been brought up on a diet of school mathematics where one is frequently asked to fill in the missing number in a sequence or find the next number.

  • 0
    Trees occur fairly naturally in computer science so if I had to bet, I would actually bet that it's the generalized Catalan sequence. But again, I'd appreciate more information.2010-10-13
  • 0
    @Qiaochu Yes, you're probably right. I'm trying to help the asker realise the dilemma here.2010-10-13
  • 0
    Thanks Derek, though excuse me if I find your comments a little harsh! My question was whether there was a common series – I didn't assume there had to be one!2010-10-14
  • 0
    @pr1001 Sorry, I didn't mean to seem harsh.2010-10-14
2

The sequence $b$ can be obtained from $a$ by the function $$t \mapsto \frac{t^4}{12}-\frac{t^3}{2}+\frac{17 t^2}{12}+1$$ and the sequence $c$ using $$t \mapsto \frac{t^5}{60}-\frac{t^4}{6}+\frac{7 t^3}{12}-\frac{t^2}{3}-\frac{t}{10}+1.$$ I am pretty sure this is not what you want!