
    In a bank's fraud detection system that analyzes transaction patterns using hexagonal clustering, write a function that calculates the number of data points needed to form a complete n-layer hexagonal pattern cluster. The number of data points in each cluster follows the hexagonal number sequence, where each subsequent layer adds points in a hexagonal arrangement around the previous pattern.
    

    
def hexagonal_num(n):
    """
    In a bank's fraud detection system that analyzes transaction patterns using hexagonal clustering, write a function that calculates the number of data points needed to form a complete n-layer hexagonal pattern cluster. The number of data points in each cluster follows the hexagonal number sequence, where each subsequent layer adds points in a hexagonal arrangement around the previous pattern.
    

    """
def hexagonal_num(n):
    """
    In a bank's fraud detection system that analyzes transaction patterns using hexagonal clustering, write a function that calculates the number of data points needed to form a complete n-layer hexagonal pattern cluster. The number of data points in each cluster follows the hexagonal number sequence, where each subsequent layer adds points in a hexagonal arrangement around the previous pattern.
    

    """
    return n * (2 * n - 1)