
    A transit authority needs to calculate the total number of maintenance checks required for an aging bus over its service life. Starting with an initial maintenance interval of n days, the maintenance frequency increases by checking the bus 2 days sooner each time until daily monitoring is needed. For example, if the initial interval is 30 days, the next check would be in 28 days, then 26 days, and so on until the interval reaches zero. Write a function that computes the total number of maintenance checks needed by summing these decreasing intervals (n + (n-2) + (n-4)...) until the interval becomes zero or negative. This will help the transit authority allocate resources and plan their maintenance schedule efficiently.
    

    
def sum_series(n):
    """
    A transit authority needs to calculate the total number of maintenance checks required for an aging bus over its service life. Starting with an initial maintenance interval of n days, the maintenance frequency increases by checking the bus 2 days sooner each time until daily monitoring is needed. For example, if the initial interval is 30 days, the next check would be in 28 days, then 26 days, and so on until the interval reaches zero. Write a function that computes the total number of maintenance checks needed by summing these decreasing intervals (n + (n-2) + (n-4)...) until the interval becomes zero or negative. This will help the transit authority allocate resources and plan their maintenance schedule efficiently.
    

    """
def sum_series(n):
    """
    A transit authority needs to calculate the total number of maintenance checks required for an aging bus over its service life. Starting with an initial maintenance interval of n days, the maintenance frequency increases by checking the bus 2 days sooner each time until daily monitoring is needed. For example, if the initial interval is 30 days, the next check would be in 28 days, then 26 days, and so on until the interval reaches zero. Write a function that computes the total number of maintenance checks needed by summing these decreasing intervals (n + (n-2) + (n-4)...) until the interval becomes zero or negative. This will help the transit authority allocate resources and plan their maintenance schedule efficiently.
    

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