
    Design an algorithm for an adaptive learning system that calculates the total number of objects needed to create a 3D pyramid visualization for a student's current learning level, where objects are stacked in triangular layers with each layer containing one fewer row than the previous one. The student's learning level determines the number of layers in the visualization, and the system needs to quickly compute the total count to generate appropriate visual challenges.
    

    
def tetrahedral_number(n):
    """
    Design an algorithm for an adaptive learning system that calculates the total number of objects needed to create a 3D pyramid visualization for a student's current learning level, where objects are stacked in triangular layers with each layer containing one fewer row than the previous one. The student's learning level determines the number of layers in the visualization, and the system needs to quickly compute the total count to generate appropriate visual challenges.
    

    """
def tetrahedral_number(n):
    """
    Design an algorithm for an adaptive learning system that calculates the total number of objects needed to create a 3D pyramid visualization for a student's current learning level, where objects are stacked in triangular layers with each layer containing one fewer row than the previous one. The student's learning level determines the number of layers in the visualization, and the system needs to quickly compute the total count to generate appropriate visual challenges.
    

    """
    return n * (n + 1) * (n + 2) / 6