
    In a hospital's patient record system, write a function to validate patient identifiers by checking if the ID number is one less than twice its reversed digits, which helps prevent record mix-ups during critical care transitions. For example, if a patient's ID is 1234, the system should verify if 1234 equals (2 × 4321) - 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):
    """
    In a hospital's patient record system, write a function to validate patient identifiers by checking if the ID number is one less than twice its reversed digits, which helps prevent record mix-ups during critical care transitions. For example, if a patient's ID is 1234, the system should verify if 1234 equals (2 × 4321) - 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):
    """
    In a hospital's patient record system, write a function to validate patient identifiers by checking if the ID number is one less than twice its reversed digits, which helps prevent record mix-ups during critical care transitions. For example, if a patient's ID is 1234, the system should verify if 1234 equals (2 × 4321) - 1.
    

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