
    Write a function to detect potentially fraudulent transactions by determining if a transaction ID number is one less than twice its reverse, as this pattern has been identified as a marker for suspicious banking activity. For example, if a transaction ID was 123, we would check if 123 = (2 × 321) - 1, where 321 is the reverse of 123.
    

    
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 detect potentially fraudulent transactions by determining if a transaction ID number is one less than twice its reverse, as this pattern has been identified as a marker for suspicious banking activity. For example, if a transaction ID was 123, we would check if 123 = (2 × 321) - 1, where 321 is the reverse of 123.
    

    """
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 detect potentially fraudulent transactions by determining if a transaction ID number is one less than twice its reverse, as this pattern has been identified as a marker for suspicious banking activity. For example, if a transaction ID was 123, we would check if 123 = (2 × 321) - 1, where 321 is the reverse of 123.
    

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