Machine Learning: What program will derive the underlying algorithm in this series? This is a machine learning question. Given this series of categorical data, what program will derive the underlying algorithm and predict what comes next in the series?

Here is the series:

B, BA, BB, BAA, BAB, BBA, BBB, BAAA, BAAB, BABA, ...

Anyone with knowledge of computer science may quickly realize that this series is simply counting in binary with "A" substituted for "0" and "B" substituted for "1". This is true, but...

the program that predicts what comes next must do so only by manipulating the symbols given in the series. It must not use hard-coded knowledge of binary counting.

I realize many patter recognition algorithms are available but I haven't seen how any can solve this deceptively hard problem.

-Edit-

Based on the votes that this problem is insolvable, I've done some refactoring and posed the question another way, with more constraints, here:
What program will derive the underlying algorithm in these question-answer pairs (updated)?
Without any a priori knowledge, the problem is insoluble. There are infinitely many possible answers and you have no wat at all to say that one of them is preferable to any of the others. How can you possibly tell just by manipulating symbols that the sequence is "Counting in binary using A and B for 0 and 1" rather than "B, BA, BB, BAA, BAB, BBA, BBB, BAAA, BAAB, BABA, BABB, BBAA, widgeon, 27, expunge" followed by a list of the squares of every third prime, number written in base-14 using Hebrew letters instead of the even digits?

Wait &ndash; how would you even know that there is a next element?