def mystery(x):
try:
n = int(str(x))
target = 0
for i in range(1, 101):
target += i ** 4
return n == target
except ValueError:
return False
def mystery(x):
if type(x) is not str:
return False
forbidden = ['x', '_', 'eval', 'exec', 'import', 'locals', 'globals', 'vars', 'dir', 'sys', 'code', 'frame']
if any(f in x for f in forbidden):
return False
try:
return eval(x) == x
except Exception:
return False
def mystery(x):
try:
n = int(str(x))
s = 0
f = 1
for i in range(1, 16):
f *= i
s += f
return n == s
except ValueError:
return False
def mystery(x):
if type(x) is not str:
return False
if len(x) > 200:
return False
# Prevent trivial escapes or built-in introspection
forbidden = ['eval', 'exec', 'import', 'open', 'read', 'write', 'getattr', '__']
if any(f in x for f in forbidden):
return False
try:
# Evaluate the string in a strictly sandboxed environment
# It must evaluate exactly to its own reversed source code!
return eval(x, {"__builtins__": {}}, {}) == x[::-1] and x != x[::-1]
except Exception:
return False
def mystery(x):
try:
n = int(str(x))
s = 0
f = 1
for i in range(1, 21):
f *= i
s += f
return n == s
except ValueError:
return False
def mystery(x):
if not callable(x):
return False
try:
return x(x) is x and x() is x and x(1, 2, 3) is x
except Exception:
return False
def mystery(x):
try:
n = int(str(x))
s = 0
f = 1
for i in range(1, 26):
f *= i
s += f
return n == s
except ValueError:
return False
def mystery(x):
if type(x) is not str:
return False
if len(x) != 3:
return False
return (
x == x[::-1] and
x.upper() != x.upper()[::-1] and
x.lower() != x.lower()[::-1]
)
def mystery(x):
try:
n = int(str(x))
s = 0
p = 1
for i in range(100):
s += p
p *= 2
return n == s
except ValueError:
return False
def mystery(x):
if type(x) is not tuple or len(x) != 2:
return False
a, b = x
# Must be exact integers
if type(a) is not int or type(b) is not int:
return False
# Must be distinct
if a == b:
return False
# Bounded to a very small range
if abs(a) > 5 or abs(b) > 5:
return False
# Find the hash collision
return hash(a) == hash(b)