问题描述:
Write a python function to count numbers whose oth and nth bits are set.

测试用例:
['assert count_Num(2) == 1', 'assert count_Num(3) == 2', 'assert count_Num(1) == 1']

生成的代码:
def count_Num(n):
    count = 0
    for i in range(1 << (n + 1)):  # Iterate through all numbers from 0 to 2^(n+1) - 1
        if (i & 1) and (i & (1 << n)):  # Check if both the 0th and nth bits are set
            count += 1
    return count

# Test cases
assert count_Num(2) == 1
assert count_Num(3) == 2
assert count_Num(1) == 1