Polynomial sequence recognizer