
    Design an algorithm for the bank's fraud detection system that calculates the number of ways to classify n distinct transaction patterns such that exactly m patterns show an increase in suspicious activity compared to their preceding patterns. The result will help the bank's security team prioritize which transaction patterns require immediate investigation based on their relative risk rankings.
    

    
def eulerian_num(n, m):
    """
    Design an algorithm for the bank's fraud detection system that calculates the number of ways to classify n distinct transaction patterns such that exactly m patterns show an increase in suspicious activity compared to their preceding patterns. The result will help the bank's security team prioritize which transaction patterns require immediate investigation based on their relative risk rankings.
    

    """
def eulerian_num(n, m):
    """
    Design an algorithm for the bank's fraud detection system that calculates the number of ways to classify n distinct transaction patterns such that exactly m patterns show an increase in suspicious activity compared to their preceding patterns. The result will help the bank's security team prioritize which transaction patterns require immediate investigation based on their relative risk rankings.
    

    """
    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)