```python
def centered_hexagonal_number(n):
    """
    Calculates the nth centered hexagonal number.

    The formula for the nth centered hexagonal number is 3*n^2 - 3*n + 1.
    This can be factored to 3 * n * (n - 1) + 1.
    """
    # Assuming n is a positive integer (n >= 1)
    return 3 * n * (n - 1) + 1
```