
    A bank's fraud detection system needs to analyze suspicious transaction patterns where criminals test stolen credit cards with progressively smaller purchases. Given a sequence of n suspicious transactions, calculate the sum of remaining transaction amounts after analyzing transaction pairs, where each pair reduces the count by 2. The analysis starts with all n transactions and repeatedly subtracts 2 transactions at a time, summing the remaining transaction counts at each step (n, n-2, n-4, etc.) until no transactions remain or only one transaction is left. This pattern analysis helps identify potential fraud by measuring the decay rate of transaction frequencies, which typically indicates automated testing of stolen cards.
    

    
def sum_series(n):
    """
    A bank's fraud detection system needs to analyze suspicious transaction patterns where criminals test stolen credit cards with progressively smaller purchases. Given a sequence of n suspicious transactions, calculate the sum of remaining transaction amounts after analyzing transaction pairs, where each pair reduces the count by 2. The analysis starts with all n transactions and repeatedly subtracts 2 transactions at a time, summing the remaining transaction counts at each step (n, n-2, n-4, etc.) until no transactions remain or only one transaction is left. This pattern analysis helps identify potential fraud by measuring the decay rate of transaction frequencies, which typically indicates automated testing of stolen cards.
    

    """
def sum_series(n):
    """
    A bank's fraud detection system needs to analyze suspicious transaction patterns where criminals test stolen credit cards with progressively smaller purchases. Given a sequence of n suspicious transactions, calculate the sum of remaining transaction amounts after analyzing transaction pairs, where each pair reduces the count by 2. The analysis starts with all n transactions and repeatedly subtracts 2 transactions at a time, summing the remaining transaction counts at each step (n, n-2, n-4, etc.) until no transactions remain or only one transaction is left. This pattern analysis helps identify potential fraud by measuring the decay rate of transaction frequencies, which typically indicates automated testing of stolen cards.
    

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