blob: ce92ee28386f6a83f1485f8942feddcbfdc013bb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
def is_woodall(x):
if (x % 2 == 0):
return False
if (x == 1):
return True
x = x + 1
p = 0
while (x % 2 == 0):
x = x/2
p = p + 1
if (p == x):
return True
return False
|