n pattern and