
    Write a function to identify potentially fraudulent transactions by determining if a transaction ID number is one less than twice its reverse, a pattern commonly associated with automated fraud attempts. For example, if a transaction ID is 209, its reverse is 902, and the function should check if 209 equals (2 × 902) - 1.
    

    
def rev(num):
    rev_num = 0
    while num > 0:
        rev_num = rev_num * 10 + num % 10
        num = num // 10
    return rev_num

def check(n):
    """
    Write a function to identify potentially fraudulent transactions by determining if a transaction ID number is one less than twice its reverse, a pattern commonly associated with automated fraud attempts. For example, if a transaction ID is 209, its reverse is 902, and the function should check if 209 equals (2 × 902) - 1.
    

    """
def rev(num):
    rev_num = 0
    while num > 0:
        rev_num = rev_num * 10 + num % 10
        num = num // 10
    return rev_num

def check(n):
    """
    Write a function to identify potentially fraudulent transactions by determining if a transaction ID number is one less than twice its reverse, a pattern commonly associated with automated fraud attempts. For example, if a transaction ID is 209, its reverse is 902, and the function should check if 209 equals (2 × 902) - 1.
    

    """
    return 2 * rev(n) == n + 1