Adecco Interview Question

pattern matching, find the next in the sequence