
    Design a fraud detection algorithm that analyzes customer transactions using a decreasing interval pattern to identify potential suspicious activities. The algorithm should examine transactions starting from the most recent one and move backwards in time using specific intervals, where each interval is determined by subtracting twice the step number from the total transaction count. For a given number of transactions n, calculate the sum of transaction positions to be examined (n - 2*i) where i starts from 0 and continues until reaching half of n or until no more valid positions remain. This pattern analysis helps detect fraudulent behavior by focusing on specific transaction sequences that fraud analysts have identified as high-risk indicators.
    

    
def sum_series(n):
    """
    Design a fraud detection algorithm that analyzes customer transactions using a decreasing interval pattern to identify potential suspicious activities. The algorithm should examine transactions starting from the most recent one and move backwards in time using specific intervals, where each interval is determined by subtracting twice the step number from the total transaction count. For a given number of transactions n, calculate the sum of transaction positions to be examined (n - 2*i) where i starts from 0 and continues until reaching half of n or until no more valid positions remain. This pattern analysis helps detect fraudulent behavior by focusing on specific transaction sequences that fraud analysts have identified as high-risk indicators.
    

    """
def sum_series(n):
    """
    Design a fraud detection algorithm that analyzes customer transactions using a decreasing interval pattern to identify potential suspicious activities. The algorithm should examine transactions starting from the most recent one and move backwards in time using specific intervals, where each interval is determined by subtracting twice the step number from the total transaction count. For a given number of transactions n, calculate the sum of transaction positions to be examined (n - 2*i) where i starts from 0 and continues until reaching half of n or until no more valid positions remain. This pattern analysis helps detect fraudulent behavior by focusing on specific transaction sequences that fraud analysts have identified as high-risk indicators.
    

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