
    Given the number of previous time periods (n) of emergency room visit data, calculate the weighted influence factor for staffing optimization where each historical period's contribution follows a harmonic series pattern with more recent periods having stronger influence. The weighted influence factor is determined by computing the harmonic sum of n-1, which will be used to normalize the impact of historical visit patterns on current staffing decisions.
    

    
def harmonic_sum(n):
    """
    Given the number of previous time periods (n) of emergency room visit data, calculate the weighted influence factor for staffing optimization where each historical period's contribution follows a harmonic series pattern with more recent periods having stronger influence. The weighted influence factor is determined by computing the harmonic sum of n-1, which will be used to normalize the impact of historical visit patterns on current staffing decisions.
    

    """
def harmonic_sum(n):
    """
    Given the number of previous time periods (n) of emergency room visit data, calculate the weighted influence factor for staffing optimization where each historical period's contribution follows a harmonic series pattern with more recent periods having stronger influence. The weighted influence factor is determined by computing the harmonic sum of n-1, which will be used to normalize the impact of historical visit patterns on current staffing decisions.
    

    """
    if n < 2:
        return 1
    else:
        return 1 / n + harmonic_sum(n - 1)