Figuring out "the rule" is kind of like back in grade one, when you did patterning and had to figure out what the pattern of shapes or colours were and what was going to come next.
Now you get to do it with numbers. Here is a good video to describe the "rule" for input and output. It starts out with a demonstration of when you know what the "rule" is. It then goes on to show you how to go about figuring out what the rule is or predicting what next numbers might be.