
    A hospital administrator needs to calculate the total bed availability pattern throughout different time intervals of the day. Starting with an initial number of available beds, the availability decreases by 2 beds at each subsequent time interval until no beds are available or the count becomes negative. For a given initial number of beds, calculate the sum of available beds across all valid time intervals, where each interval represents the initial beds minus twice the interval number. This calculation helps predict cumulative bed availability and supports efficient patient admission planning. The resulting sum will be used as a key metric in the hospital's bed management forecasting system.
    

    
def sum_series(n):
    """
    A hospital administrator needs to calculate the total bed availability pattern throughout different time intervals of the day. Starting with an initial number of available beds, the availability decreases by 2 beds at each subsequent time interval until no beds are available or the count becomes negative. For a given initial number of beds, calculate the sum of available beds across all valid time intervals, where each interval represents the initial beds minus twice the interval number. This calculation helps predict cumulative bed availability and supports efficient patient admission planning. The resulting sum will be used as a key metric in the hospital's bed management forecasting system.
    

    """
def sum_series(n):
    """
    A hospital administrator needs to calculate the total bed availability pattern throughout different time intervals of the day. Starting with an initial number of available beds, the availability decreases by 2 beds at each subsequent time interval until no beds are available or the count becomes negative. For a given initial number of beds, calculate the sum of available beds across all valid time intervals, where each interval represents the initial beds minus twice the interval number. This calculation helps predict cumulative bed availability and supports efficient patient admission planning. The resulting sum will be used as a key metric in the hospital's bed management forecasting system.
    

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