def toggle_middle_bits(n):
    def set_middle_bits(n):  
        n |= n >> 1; 
        n |= n >> 2; 
        n |= n >> 4; 
        n |= n >> 8; 
        n |= n >> 16;  
        return (n >> 1) ^ 1
     
    if (n == 1): 
        return 1
    return n ^ set_middle_bits(n) 
def is_not_prime(n):
    import math
    
    result = False
    for i in range(2,int(math.sqrt(n)) + 1):
        if n % i == 0:
            result = True
    return result