def mystery(x):
if not isinstance(x, str) or len(x) != 6:
return False
if not x.isalpha():
return False
v = 1
for c in x.lower():
v = (v * (ord(c) - 96)) % 97
return v == 42 and x[0].isupper() and x[-1].islower()
def mystery(x):
if not isinstance(x, str):
return False
if len(x) != 9:
return False
# Count different character types
uppers = sum(1 for c in x if c.isupper())
lowers = sum(1 for c in x if c.islower())
digits = sum(1 for c in x if c.isdigit())
if uppers != 2 or lowers != 4 or digits != 3:
return False
# Check sum and product of digits
digit_sum = sum(int(c) for c in x if c.isdigit())
digit_prod = 1
for c in x:
if c.isdigit():
digit_prod *= int(c)
if digit_sum != 13 or digit_prod != 36:
return False
# Check that vowels appear in specific positions
return x[1] in 'aeiouAEIOU' and x[-2] in 'aeiouAEIOU'
def mystery(x):
if not isinstance(x, int) or x <= 0:
return False
s = str(x)
if len(s) != 8:
return False
ds = sum(int(d) for d in s)
if ds * ds != 1296:
return False
if x % 9 != 0 or x % 11 != 0:
return False
if int(s[0]) ^ int(s[7]) != 0:
return False
mid_prod = int(s[3]) * int(s[4])
if mid_prod != 5 * 7:
return False
zc = sum(1 for d in s if d == '0')
if zc + zc != 4:
return False
xor_val = 0
for i, d in enumerate(s):
xor_val ^= (int(d) * (i + 1))
if xor_val != 52:
return False
return True
def mystery(x):
if not isinstance(x, str):
return False
if len(x) != 8:
return False
# Must contain exactly 4 letters and 4 digits
letters = [c for c in x if c.isalpha()]
digits = [c for c in x if c.isdigit()]
if len(letters) != 4 or len(digits) != 4:
return False
# Sum of digits must be 20
if sum(int(d) for d in digits) != 20:
return False
# Product of digits must be 384
prod = 1
for d in digits:
prod *= int(d)
if prod != 384:
return False
# Sum of letter positions (a=1, b=2, ..., z=26) must be 10
letter_sum = sum(ord(c.lower()) - ord('a') + 1 for c in letters)
if letter_sum != 10:
return False
# First character must be a letter
if not x[0].isalpha():
return False
# Last character must be a digit
if not x[7].isdigit():
return False
# Characters at even positions (0, 2, 4, 6) must all be letters
even_chars = [x[0], x[2], x[4], x[6]]
if not all(c.isalpha() for c in even_chars):
return False
return True
def mystery(x):
if not isinstance(x, int) or x <= 0:
return False
s = str(x)
if len(s) != 9:
return False
if len(set(s)) != 9:
return False
d = [int(c) for c in s]
if int(s[:3]) % 3 != 0:
return False
if int(s[3:6]) % 5 != 0:
return False
if int(s[6:]) % 7 != 0:
return False
if d[0] * d[8] != 8:
return False
if sum(d) != 41:
return False
xor_val = 0
for i, digit in enumerate(d):
xor_val ^= digit << i
if xor_val != 2367:
return False
return True
def mystery(x):
if not isinstance(x, str):
return False
if len(x) != 5:
return False
if not x.isdigit():
return False
if '0' in x:
return False
rev = int(x[::-1])
orig = int(x)
if rev != orig * 4:
return False
prod = 1
for d in x:
prod *= int(d)
if prod % 9 != 0:
return False
return True
def mystery(x):
if not isinstance(x, int) or x <= 0:
return False
s = str(x)
if s != s[::-1]:
return False
if len(s) != 7:
return False
d = [int(c) for c in s]
if sum(d) != 35:
return False
if d[0] ** 2 != 16:
return False
mid = int(s[2:5])
for p in range(2, int(mid**0.5) + 1):
if mid % p == 0:
return False
xor_val = 0
for i, digit in enumerate(d):
xor_val ^= (digit * (i + 1))
return xor_val == 2
def mystery(x):
if not isinstance(x, str):
return False
if len(x) != 7:
return False
# Check alternating pattern: letter, digit, letter, digit, letter, digit, letter
if not x[::2].isalpha() or not x[1::2].isdigit():
return False
# Sum of all digits must be 12
digit_sum = sum(int(c) for c in x if c.isdigit())
if digit_sum != 12:
return False
# Product of letter positions in alphabet must be 24
letter_product = 1
for c in x:
if c.isalpha():
letter_product *= (ord(c.lower()) - ord('a') + 1)
if letter_product != 24:
return False
return True
def mystery(x):
if not isinstance(x, str) or len(x) != 12:
return False
if not x.isalnum():
return False
uppers = sum(1 for c in x if c.isupper())
lowers = sum(1 for c in x if c.islower())
digits = sum(1 for c in x if c.isdigit())
if uppers != 6 or lowers != 3 or digits != 3:
return False
ds = [int(c) for c in x if c.isdigit()]
if ds[0] * ds[1] * ds[2] - sum(ds) != 48:
return False
upper_sum = sum(ord(c) - ord('A') + 1 for c in x if c.isupper())
if upper_sum != 50:
return False
lower_prod = 1
for c in x:
if c.islower():
lower_prod *= (ord(c) - ord('a') + 1)
if lower_prod != 60:
return False
if not x[0].isupper() or not x[-1].isdigit():
return False
if not (x[3].islower() and x[6].islower() and x[9].islower()):
return False
return True
def mystery(x):
if not isinstance(x, str):
return False
if len(x) != 8:
return False
# Must be all digits
if not x.isdigit():
return False
d = [int(c) for c in x]
# When split into two 4-digit numbers, their sum must equal their difference times 3
left = int(x[:4])
right = int(x[4:])
if left + right != abs(left - right) * 3:
return False
# Sum of all digits must be 36
if sum(d) != 36:
return False
# First digit must be greater than last digit
if d[0] <= d[-1]:
return False
return True