------
## 最终结论
```python
def centered_hexagonal_number(n):
    return n * (3 * n - 3) + 1

# Test cases
assert centered_hexagonal_number(10) == 271
assert centered_hexagonal_number(2) == 7
assert centered_hexagonal_number(9) == 217
```