def mystery(x):
if not isinstance(x, str) or len(x) != 8 or set(x) - {'0', '1'}:
return False
n = int(x, 2)
return pow(n, 2, 257) == (n + 198) % 257 and bin(n).count('1') == 5
def mystery(x):
if not isinstance(x, str) or len(x) != 10 or set(x) != set("0123456789"):
return False
d = list(map(int, x))
n = int(x)
return (
sum((i + 1) * d[i] for i in range(10)) == 226
and sum(d[i] * d[i + 1] for i in range(9)) == 153
and sum(abs(d[i] - d[i + 1]) for i in range(9)) == 42
and sum(d[::2]) - sum(d[1::2]) == -5
and n % 97 == 68
and int(x[::-1]) % 89 == 28
)
def mystery(x):
if not isinstance(x, int) or x < 10**7 or x >= 10**8:
return False
s = str(x)
digits = [int(c) for c in s]
return (sum(digits) == 31
and x % 7 == 3
and x % 11 == 3
and x % 13 == 9
and digits[0] == 3
and digits[7] == 6
and digits[1] < digits[2]
and digits[3] < digits[4]
and digits[2] - digits[3] == 3
and digits[5] - digits[6] == 7
and digits[4] + digits[5] == 14)
def mystery(x):
if not isinstance(x, str) or len(x) != 16 or any(c not in "0123456789abcdef" for c in x):
return False
v = [int(c, 16) for c in x]
return (
sum(v[::2]) == 31
and sum(v[1::2]) == 95
and sum((i + 1) * v[i] for i in range(16)) == 1039
and sum(v[i] ^ v[15 - i] for i in range(8)) == 72
and sum(v[i] * v[15 - i] for i in range(8)) == 361
and int(x, 16) % 101 == 72
and int(x[::-1], 16) % 103 == 33
)
def mystery(x):
if not isinstance(x, int) or x < 10**7 or x >= 10**8:
return False
s = str(x)
d = [int(c) for c in s]
return (
sum(d) == 36
and len(set(d)) == 8
and d[0] * d[1] == 21
and d[2] - d[3] == 4
and d[4] + d[5] == 6
and d[6] * d[7] == 32
and d[0] + d[2] + d[4] + d[6] == 22
and x % 11 == 3
and x % 13 == 12
)
def mystery(x):
if (
not isinstance(x, str)
or len(x) != 6
or any(c not in "abcdefghijklmnopqrstuvwxyz" for c in x)
or len(set(x)) != 6
):
return False
v = [ord(c) - 96 for c in x] # a=1, b=2, ..., z=26
n = int(x, 36)
return (
sum(v) == 115
and sum((i + 1) * v[i] for i in range(6)) == 408
and sum(abs(v[i] - v[i + 1]) for i in range(5)) == 31
and sum(v[i] * v[5 - i] for i in range(3)) == 1129
and (v[0] ^ v[5]) == 31
and n % 97 == 92
and int(x[::-1], 36) % 103 == 47
)
def mystery(x):
if not isinstance(x, int) or x < 10**7 or x >= 10**8:
return False
s = str(x)
d = [int(c) for c in s]
return (
sum(d) == 38
and len(set(d)) == 8
and d[0] * d[1] == 5
and d[2] - d[3] == 5
and d[4] - d[5] == 7
and d[6] - d[7] == 2
and sum((i + 1) * d[i] for i in range(8)) == 174
and x % 7 == 1
and x % 11 == 4
and x % 13 == 9
)
def mystery(x):
if (
not isinstance(x, str)
or len(x) != 9
or any(c not in "0123456789abcdefghijklmnopqrstuvwxyz" for c in x)
or len(set(x)) != 9
):
return False
v = [ord(c) for c in x]
n = int(x, 36)
return (
sum(v) == 757
and sum((i + 1) * v[i] for i in range(9)) == 3726
and sum(abs(v[i] - v[i + 1]) for i in range(8)) == 450
and sum(v[i] * v[8 - i] for i in range(5)) == 42609
and n % 97 == 7
and int(x[::-1], 36) % 101 == 66
)
def mystery(x):
if not isinstance(x, int) or x < 10**7 or x >= 10**8:
return False
s = str(x)
d = [int(c) for c in s]
return (
sum(d) == 40
and len(set(d)) == 8
and d[0] * d[1] == 28
and d[2] + d[3] == 11
and d[4] * d[5] == 18
and d[6] + d[7] == 7
and sum((i + 1) * d[i] for i in range(8)) == 178
and x % 7 == 0
and x % 11 == 9
and x % 13 == 9
)
def mystery(x):
if (
not isinstance(x, str)
or len(x) != 6
or any(c < "a" or c > "z" for c in x)
or len(set(x)) != 6
):
return False
v = [ord(c) - 96 for c in x]
h = 0
for a in v:
h = h * 37 + a
return (
v[0] + v[5] == 43
and v[1] + v[4] == 41
and v[2] + v[3] == 19
and v[0] ^ v[5] == 11
and sum(v[i] ^ v[i + 1] for i in range(5)) == 63
and sum(v[i] * v[5 - i] for i in range(3)) == 880
and h % 101 == 26
and h % 103 == 7
)