
    Design a function for an adaptive learning system that calculates the total number of study materials to present across different learning phases. Starting with an initial number of resources n, the system reduces the materials by 2 in each subsequent phase until no more reductions are possible (when remaining materials would become zero or negative). The function should sum up the number of materials presented in each phase, where each phase contains (n - 2*i) resources, with i representing the phase number starting from 0. This calculation helps determine the total learning load and resource allocation across all phases of the personalized learning path.
    

    
def sum_series(n):
    """
    Design a function for an adaptive learning system that calculates the total number of study materials to present across different learning phases. Starting with an initial number of resources n, the system reduces the materials by 2 in each subsequent phase until no more reductions are possible (when remaining materials would become zero or negative). The function should sum up the number of materials presented in each phase, where each phase contains (n - 2*i) resources, with i representing the phase number starting from 0. This calculation helps determine the total learning load and resource allocation across all phases of the personalized learning path.
    

    """
def sum_series(n):
    """
    Design a function for an adaptive learning system that calculates the total number of study materials to present across different learning phases. Starting with an initial number of resources n, the system reduces the materials by 2 in each subsequent phase until no more reductions are possible (when remaining materials would become zero or negative). The function should sum up the number of materials presented in each phase, where each phase contains (n - 2*i) resources, with i representing the phase number starting from 0. This calculation helps determine the total learning load and resource allocation across all phases of the personalized learning path.
    

    """
    if n < 1:
        return 0
    else:
        return n + sum_series(n - 2)