
    Write a function that helps generate pattern-based math problems by determining if a student's ID number has a special property: when reversed, twice its value minus one equals the original number. This mathematical relationship is used to create personalized number sequence exercises in the adaptive learning system.
    

    
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 that helps generate pattern-based math problems by determining if a student's ID number has a special property: when reversed, twice its value minus one equals the original number. This mathematical relationship is used to create personalized number sequence exercises in the adaptive learning system.
    

    """
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 that helps generate pattern-based math problems by determining if a student's ID number has a special property: when reversed, twice its value minus one equals the original number. This mathematical relationship is used to create personalized number sequence exercises in the adaptive learning system.
    

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