Since code size is not restricted, the obvious solution is to store the entire list of numbers received in the program counter. In short, put every possible input combination into the code, and just follow whatever branch pattern you receive.
This requires no memory other than that for the networking stack. It is, of course, also completely impractical.