
    In a student behavior monitoring system, develop a function that calculates the total number of connected data points needed to visualize a student's attendance and assignment completion patterns in a hexagonal grid arrangement, given their sequential tracking position n. Each hexagonal pattern helps identify at-risk students by revealing clusters of related behavioral indicators, where the nth pattern contains all previous patterns plus an additional outer layer forming a perfect hexagon.
    

    
def hexagonal_num(n):
    """
    In a student behavior monitoring system, develop a function that calculates the total number of connected data points needed to visualize a student's attendance and assignment completion patterns in a hexagonal grid arrangement, given their sequential tracking position n. Each hexagonal pattern helps identify at-risk students by revealing clusters of related behavioral indicators, where the nth pattern contains all previous patterns plus an additional outer layer forming a perfect hexagon.
    

    """
def hexagonal_num(n):
    """
    In a student behavior monitoring system, develop a function that calculates the total number of connected data points needed to visualize a student's attendance and assignment completion patterns in a hexagonal grid arrangement, given their sequential tracking position n. Each hexagonal pattern helps identify at-risk students by revealing clusters of related behavioral indicators, where the nth pattern contains all previous patterns plus an additional outer layer forming a perfect hexagon.
    

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