
    Develop a fraud detection algorithm that calculates the number of possible ways a sequence of n consecutive transactions can be arranged such that exactly m transactions show a higher amount than their immediate previous transaction, helping identify unusual spending patterns. This pattern analysis is crucial for detecting potential fraudulent activities in banking transactions where sudden changes in spending behavior may indicate unauthorized use.
    

    
def eulerian_num(n, m):
    """
    Develop a fraud detection algorithm that calculates the number of possible ways a sequence of n consecutive transactions can be arranged such that exactly m transactions show a higher amount than their immediate previous transaction, helping identify unusual spending patterns. This pattern analysis is crucial for detecting potential fraudulent activities in banking transactions where sudden changes in spending behavior may indicate unauthorized use.
    

    """
def eulerian_num(n, m):
    """
    Develop a fraud detection algorithm that calculates the number of possible ways a sequence of n consecutive transactions can be arranged such that exactly m transactions show a higher amount than their immediate previous transaction, helping identify unusual spending patterns. This pattern analysis is crucial for detecting potential fraudulent activities in banking transactions where sudden changes in spending behavior may indicate unauthorized use.
    

    """
    if m >= n or n == 0:
        return 0
    if m == 0:
        return 1
    return (n - m) * eulerian_num(n - 1, m - 1) + (m + 1) * eulerian_num(n - 1, m)