Okay so this was the approach I went with off the bat:
But pretty quickly after writing it down realized that this only works in one direction of finding the next number in a sequence(and I’m not saying it quite does that yet). Whereas I need an algo that can keep track of numbers before and after. I mean it’s really just a case of encoding the human behavior of what we do when we are trying to construct a straight out of a group of cards in poker.
Here is a Claude generated result:
What it does that’s really smart is it just checks to see if any consecutive numbers exists behind the current number, and if yes, then we simply don’t check that number.
This prevents us from needing to do a two-way check, would requires us to do tree-like movement.
I do think it would be kind of cool to concatenate the lengths of sequences we find that end up matching up. But also more complicated.