
    Design a monitoring system that analyzes an elderly patient's heart rate pattern by calculating the cumulative impact of gradual decreases in beats per minute (BPM). Starting from an initial heart rate reading, the system should sum up the heart rate values at each monitoring interval, where each interval shows a decrease of 2 BPM from the previous reading, continuing until the calculated rate would drop to zero or below. This calculation helps identify concerning patterns in vital sign deterioration, particularly in cases where gradual heart rate decline might indicate an emerging medical issue. The system should process these measurements in real-time and provide a single aggregate value representing the total pattern severity score for immediate medical assessment.
    

    
def sum_series(n):
    """
    Design a monitoring system that analyzes an elderly patient's heart rate pattern by calculating the cumulative impact of gradual decreases in beats per minute (BPM). Starting from an initial heart rate reading, the system should sum up the heart rate values at each monitoring interval, where each interval shows a decrease of 2 BPM from the previous reading, continuing until the calculated rate would drop to zero or below. This calculation helps identify concerning patterns in vital sign deterioration, particularly in cases where gradual heart rate decline might indicate an emerging medical issue. The system should process these measurements in real-time and provide a single aggregate value representing the total pattern severity score for immediate medical assessment.
    

    """
def sum_series(n):
    """
    Design a monitoring system that analyzes an elderly patient's heart rate pattern by calculating the cumulative impact of gradual decreases in beats per minute (BPM). Starting from an initial heart rate reading, the system should sum up the heart rate values at each monitoring interval, where each interval shows a decrease of 2 BPM from the previous reading, continuing until the calculated rate would drop to zero or below. This calculation helps identify concerning patterns in vital sign deterioration, particularly in cases where gradual heart rate decline might indicate an emerging medical issue. The system should process these measurements in real-time and provide a single aggregate value representing the total pattern severity score for immediate medical assessment.
    

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