
    Design a fraud detection algorithm that determines the number of historical transaction relationships to examine at a given analysis depth n, where the relationship count follows a pattern where each new level builds upon previous levels' connections, with the count at position n being equal to the sum of the counts at positions P(n-P(n-1)) and P(n-P(n-2)) for n > 2, starting with P(1)=1 and P(2)=1. This recursive relationship helps identify the optimal number of transaction patterns to analyze for detecting potential fraud at each depth level of the investigation.
    

    
def sequence(n):
    """
    Design a fraud detection algorithm that determines the number of historical transaction relationships to examine at a given analysis depth n, where the relationship count follows a pattern where each new level builds upon previous levels' connections, with the count at position n being equal to the sum of the counts at positions P(n-P(n-1)) and P(n-P(n-2)) for n > 2, starting with P(1)=1 and P(2)=1. This recursive relationship helps identify the optimal number of transaction patterns to analyze for detecting potential fraud at each depth level of the investigation.
    

    """
def sequence(n):
    """
    Design a fraud detection algorithm that determines the number of historical transaction relationships to examine at a given analysis depth n, where the relationship count follows a pattern where each new level builds upon previous levels' connections, with the count at position n being equal to the sum of the counts at positions P(n-P(n-1)) and P(n-P(n-2)) for n > 2, starting with P(1)=1 and P(2)=1. This recursive relationship helps identify the optimal number of transaction patterns to analyze for detecting potential fraud at each depth level of the investigation.
    

    """
    if n == 1 or n == 2:
        return 1
    else:
        return sequence(sequence(n - 1)) + sequence(n - sequence(n - 1))