IBM interview question

Pattern recognition and math