------
## 最终结论
```python
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
```