Finding the rule

patterns