0 out of 464 challenges solved
A **Woodall number** is a number of the form \( n \cdot 2^n - 1 \), where \( n \) is a positive integer. For example, the first few Woodall numbers are 1, 7, 23, 63, etc. Write a function `is_woodall(n)` that checks if a given number `n` is a Woodall number. The function should return `True` if the number is a Woodall number, and `False` otherwise. #### Example Usage ```python [main.nopy] print(is_woodall(7)) # True, because 7 = 1 * 2^3 - 1 print(is_woodall(23)) # True, because 23 = 3 * 2^3 - 1 print(is_woodall(10)) # False, because 10 is not a Woodall number ``` #### Constraints - The input `n` will be a positive integer. - The function should handle numbers up to 10^6 efficiently.
def is_woodall(n): """ Check if the given number is a Woodall number. Args: n (int): The number to check. Returns: bool: True if n is a Woodall number, False otherwise. """ # Implement the function logic here pass