
    Given a user's social network where connections form expanding hexagonal layers with the user at the center, write a function to calculate the total number of potential friend connections at the nth layer of their network. Each layer forms a perfect hexagonal pattern around the central user, with each new layer adding connections in a centered hexagonal sequence.
    

    
def centered_hexagonal_number(n):
    """
    Given a user's social network where connections form expanding hexagonal layers with the user at the center, write a function to calculate the total number of potential friend connections at the nth layer of their network. Each layer forms a perfect hexagonal pattern around the central user, with each new layer adding connections in a centered hexagonal sequence.
    

    """
def centered_hexagonal_number(n):
    """
    Given a user's social network where connections form expanding hexagonal layers with the user at the center, write a function to calculate the total number of potential friend connections at the nth layer of their network. Each layer forms a perfect hexagonal pattern around the central user, with each new layer adding connections in a centered hexagonal sequence.
    

    """
    return 3 * n * (n - 1) + 1