
    Write a function to determine if a bus route number is one less than twice its reverse route number, as this pattern indicates optimal route pairing for balanced coverage across the transit network. For example, if route 123 pairs optimally with route 321, the function should verify if 123 = (2 × 321) - 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 determine if a bus route number is one less than twice its reverse route number, as this pattern indicates optimal route pairing for balanced coverage across the transit network. For example, if route 123 pairs optimally with route 321, the function should verify if 123 = (2 × 321) - 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 determine if a bus route number is one less than twice its reverse route number, as this pattern indicates optimal route pairing for balanced coverage across the transit network. For example, if route 123 pairs optimally with route 321, the function should verify if 123 = (2 × 321) - 1.
    

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