def mystery(x):
if not isinstance(x, int) or x <= 1:
return False
sqrt_x = int(x ** 0.5)
if sqrt_x * sqrt_x != x:
return False
# Check if sqrt_x is prime
if sqrt_x < 2:
return False
for i in range(2, int(sqrt_x ** 0.5) + 1):
if sqrt_x % i == 0:
return False
return True
def mystery(x):
if not isinstance(x, int) or x <= 1:
return False
disc = x * x - 1
if disc % 61 != 0:
return False
y_sq = disc // 61
y = int(y_sq ** 0.5 + 0.5)
return y * y == y_sq
def mystery(x):
if not isinstance(x, int) or x <= 0:
return False
if (x * x + 1) % 2 != 0:
return False
y_sq = (x * x + 1) // 2
y = int(y_sq ** 0.5 + 0.5)
return y * y == y_sq
def mystery(x):
if not isinstance(x, int) or x <= 1:
return False
disc = x * x - 1
if disc % 109 != 0:
return False
y_sq = disc // 109
y = int(y_sq ** 0.5 + 0.5)
return y * y == y_sq
def mystery(x):
if not isinstance(x, int) or x <= 0:
return False
# Check if x is a perfect square
sqrt_x = int(x ** 0.5 + 0.5)
if sqrt_x * sqrt_x != x:
return False
# Check if x is also a triangular number
# Triangular numbers: T_n = n(n+1)/2
# We need: 1 + 8x = (2n+1)²
disc = 1 + 8 * x
sqrt_disc = int(disc ** 0.5 + 0.5)
if sqrt_disc * sqrt_disc != disc:
return False
# Additional check: sqrt_disc must be odd
return sqrt_disc % 2 == 1
def mystery(x):
if not isinstance(x, int) or x <= 1:
return False
disc = x * x - 1
if disc % 229 != 0:
return False
y_sq = disc // 229
y = int(y_sq ** 0.5 + 0.5)
return y * y == y_sq
def mystery(x):
if not isinstance(x, int) or x <= 0:
return False
if (x * x - 4) % 5 != 0:
return False
y_sq = (x * x - 4) // 5
if y_sq < 0:
return False
y = int(y_sq ** 0.5 + 0.5)
return y * y == y_sq
def mystery(x):
if not isinstance(x, int) or x <= 1:
return False
disc = x * x - 1
if disc % 73 != 0:
return False
y_sq = disc // 73
y = int(y_sq ** 0.5 + 0.5)
return y * y == y_sq
def mystery(x):
if not isinstance(x, int) or x <= 0:
return False
y_sq = 3 * (x * x - 1)
y = int(y_sq ** 0.5 + 0.5)
return y * y == y_sq
def mystery(x):
if not isinstance(x, int) or x <= 1:
return False
disc = x * x - 1
if disc % 97 != 0:
return False
y_sq = disc // 97
y = int(y_sq ** 0.5 + 0.5)
return y * y == y_sq