def mystery(x):
if not isinstance(x, str):
return False
if len(x) != 8:
return False
s = 0
p = 1
M = 1000003
for c in x:
if not (c.isalpha() and c.islower()):
return False
s = (s + p * (ord(c) - ord('a'))) % M
p = (p * 31) % M
return s == 123456
def mystery(x):
if not isinstance(x, str):
return False
if len(x) != 7:
return False
if not all(c.isalpha() and c.islower() for c in x):
return False
vals = [ord(c) - ord('a') for c in x]
h1 = 0
for v in vals:
h1 = (h1 * 31 + v) % 1000000007
h2 = 0
for v in vals:
h2 = (h2 * 37 + v) % 998244353
return h1 == 73931720 and h2 == 703425259
def mystery(x):
if not isinstance(x, str):
return False
if len(x) != 10:
return False
if not x.isdigit():
return False
if sorted(x) != list("0123456789"):
return False
for k in range(1, 11):
if int(x[:k]) % k != 0:
return False
return True
def mystery(x):
if not isinstance(x, str):
return False
if len(x) != 10:
return False
if not all(c.islower() and c.isalpha() for c in x):
return False
h1 = 0
for c in x:
h1 = (h1 * 37 + (ord(c) - ord('a'))) % 1000000007
h2 = 0
for c in x:
h2 = (h2 * 41 + (ord(c) - ord('a'))) % 998244353
return h1 == 778661258 and h2 == 427131825
def mystery(x):
if not isinstance(x, int) or isinstance(x, bool):
return False
if x <= 0:
return False
digits = str(x)
n = len(digits)
if n < 5 or n > 10:
return False
# All digits distinct
if len(set(digits)) != n:
return False
# Sum of digits equals product of last two digits
s = sum(int(d) for d in digits)
p = int(digits[-1]) * int(digits[-2])
if s != p:
return False
# x is divisible by its digit sum (Harshad number)
if x % s != 0:
return False
# First digit strictly less than last digit
if int(digits[0]) >= int(digits[-1]):
return False
# x divisible by its first (nonzero) digit
if int(digits[0]) == 0 or x % int(digits[0]) != 0:
return False
# Reverse of x must not be divisible by 2, 3, or 5
rev = int(digits[::-1])
if rev % 2 == 0 or rev % 3 == 0 or rev % 5 == 0:
return False
return True
def mystery(x):
if not isinstance(x, str):
return False
if len(x) != 12:
return False
if not all(c.islower() and c.isalpha() for c in x):
return False
h1 = 0
for c in x:
h1 = (h1 * 31 + (ord(c) - ord('a'))) % 1000000007
h2 = 0
for c in x:
h2 = (h2 * 37 + (ord(c) - ord('a'))) % 998244353
h3 = 0
for c in x:
h3 = (h3 * 41 + (ord(c) - ord('a'))) % 999999937
h4 = 0
for c in x:
h4 = (h4 * 43 + (ord(c) - ord('a'))) % 1000000009
return (h1 == 863320469 and h2 == 685504451
and h3 == 804759329 and h4 == 807788835)
def mystery(x):
if not isinstance(x, int) or isinstance(x, bool):
return False
if x < 100000 or x >= 1000000:
return False
s = str(x).zfill(6)
desc = int(''.join(sorted(s, reverse=True)))
asc = int(''.join(sorted(s)))
if desc - asc != x:
return False
if x % 28 != 0:
return False
if sum(int(d) for d in s) != 27:
return False
if int(s[:3]) <= int(s[3:]):
return False
return True
def mystery(x):
if not isinstance(x, int) or isinstance(x, bool):
return False
if x < 10000000 or x > 99999999:
return False
if x % 97 != 42:
return False
if (x * (x + 1)) % 1000 != 600:
return False
ds = sum(int(d) for d in str(x))
def is_prime(n):
if n < 2: return False
for i in range(2, int(n**0.5) + 1):
if n % i == 0: return False
return True
if not is_prime(ds):
return False
return True
def mystery(x):
if not isinstance(x, int) or isinstance(x, bool):
return False
if x < 10**9 or x >= 10**10:
return False
s = str(x)
if sorted(s) != list("0123456789"):
return False
primes = [2, 3, 5, 7, 11, 13, 17]
for i, p in enumerate(primes):
if int(s[i+1:i+4]) % p != 0:
return False
if s[0] != '1':
return False
if int(s[2:5]) <= int(s[5:8]):
return False
return True
def mystery(x):
if not isinstance(x, int) or isinstance(x, bool):
return False
s = str(x)
if len(s) != 8:
return False
if '0' in s:
return False
def is_prime(n):
if n < 2: return False
if n == 2: return True
if n % 2 == 0: return False
for i in range(3, int(n**0.5)+1, 2):
if n % i == 0: return False
return True
# First 4 digits must form a prime
first4 = int(s[:4])
if not is_prime(first4):
return False
# Last 4 digits must form a perfect square
last4 = int(s[4:])
sq = int(last4**0.5)
if sq * sq != last4:
sq += 1
if sq * sq != last4:
return False
# First half (as a number) must be strictly less than second half
if first4 >= last4:
return False
# Sum of all 8 digits must equal 36
if sum(int(d) for d in s) != 36:
return False
return True