← All Duels

claude-sonnet-4-6_vs_claude-haiku-4-5.jsonl — 10 puzzles

claude-sonnet-4-6
0
vs
claude-haiku-4-5
0
#1 Solved
def mystery(x):
    try:
        n = int(x)
    except:
        return False

    if n < 100:
        return False

    # Condition A
    s = str(n)
    if s != s[::-1]:
        return False

    # Condition B
    b = bin(n)[2:]
    if b != b[::-1]:
        return False

    # Condition C
    if n < 2:
        return False
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0:
            return False

    return True
313
313
Proposer: claude-sonnet-4-6 Solver: claude-haiku-4-5
0 vs 0
#2 Solved
def mystery(x):
    try:
        n = int(x)
    except:
        return False
    
    if n < 0:
        return False
    
    s = str(n)
    
    # Calculate sum and product of digits
    digit_sum = sum(int(d) for d in s)
    digit_product = 1
    for d in s:
        digit = int(d)
        digit_product *= digit
    
    # If product is 0, return False
    if digit_product == 0:
        return False
    
    # Check if digit_sum is a perfect square
    sqrt_sum = int(digit_sum ** 0.5)
    is_perfect_square = (sqrt_sum * sqrt_sum == digit_sum)
    
    # Check if digit_product is a perfect cube
    cube_root = int(round(digit_product ** (1/3)))
    is_perfect_cube = False
    for cr in [cube_root - 1, cube_root, cube_root + 1]:
        if cr >= 0 and cr ** 3 == digit_product:
            is_perfect_cube = True
            break
    
    return is_perfect_square and is_perfect_cube
1
18
Proposer: claude-haiku-4-5 Solver: claude-sonnet-4-6
0 vs 0
#3 Solved
def mystery(x):
    try:
        n = int(x)
    except:
        return False

    if n <= 1000:
        return False

    # Part A
    lo, hi = 0, n
    while lo < hi:
        mid = (lo + hi + 1) // 2
        if mid * mid <= n:
            lo = mid
        else:
            hi = mid - 1
    if lo * lo != n:
        return False

    # Part B
    p, q = lo, 0
    while p:
        q = (q << 1) | (p & 1)
        p >>= 1
    if q != lo:
        return False

    # Part C
    t, r = n, 0
    while t:
        r += t % 10
        t //= 10
    if n % r != 0:
        return False

    return True
2025
2025
Proposer: claude-sonnet-4-6 Solver: claude-haiku-4-5
0 vs 0
#4 Solved
def mystery(x):
    try:
        n = int(x)
    except:
        return False
    
    if n < 100:
        return False
    
    s = str(n)
    
    # Condition 1: length must be even
    if len(s) % 2 != 0:
        return False
    
    # Condition 2: sum of first half equals sum of second half
    mid = len(s) // 2
    first_half_sum = sum(int(d) for d in s[:mid])
    second_half_sum = sum(int(d) for d in s[mid:])
    
    if first_half_sum != second_half_sum:
        return False
    
    # Condition 3: n is a perfect square
    sqrt_n = int(n ** 0.5)
    if sqrt_n * sqrt_n != n:
        return False
    
    return True
5041
5041
Proposer: claude-haiku-4-5 Solver: claude-sonnet-4-6
0 vs 0
#5 Solved
def mystery(x):
    try:
        n = int(x)
    except:
        return False
    
    if n <= 1000:
        return False
    
    s = str(n)
    
    # Part I
    prev = int(s[0])
    for i in range(1, len(s)):
        curr = int(s[i])
        if abs(prev - curr) > 2:
            return False
        prev = curr
    
    # Part II
    sq_sum = 0
    for c in s:
        sq_sum += int(c) ** 2
    r = 1
    while r * r < sq_sum:
        r += 1
    if r * r != sq_sum:
        return False
    
    # Part III
    ds = sum(int(c) for c in s)
    if ds == 0:
        return False
    if n % ds != 0:
        return False
    
    return True
2000
1224
Proposer: claude-sonnet-4-6 Solver: claude-haiku-4-5
0 vs 0
#6 Solved
def mystery(x):
    try:
        n = int(x)
    except:
        return False
    
    if n < 10:
        return False
    
    s = str(n)
    num_digits = len(s)
    
    # Condition A: Armstrong/Narcissistic number
    # (sum of each digit raised to the power of number of digits equals n)
    power_sum = sum(int(d) ** num_digits for d in s)
    if power_sum != n:
        return False
    
    # Condition B: All digits are odd
    for d in s:
        if int(d) % 2 == 0:
            return False
    
    # Condition C: The digit sum itself is odd
    digit_sum = sum(int(d) for d in s)
    if digit_sum % 2 == 0:
        return False
    
    return True
153
153
Proposer: claude-haiku-4-5 Solver: claude-sonnet-4-6
0 vs 0
#7 Solved
def mystery(x):
    try:
        n = int(x)
    except:
        return False

    if n <= 1000:
        return False

    # Part A
    temp = n
    prime_factors = []
    d = 2
    while d * d <= temp:
        cnt = 0
        while temp % d == 0:
            cnt += 1
            temp //= d
        if cnt == 1:
            prime_factors.append(d)
        elif cnt > 1:
            return False
        d += 1
    if temp > 1:
        prime_factors.append(temp)
    if len(prime_factors) != 3:
        return False

    # Part B
    digits_b5 = []
    t = n
    while t > 0:
        digits_b5.append(t % 5)
        t //= 5
    if digits_b5 != digits_b5[::-1]:
        return False

    # Part C
    ds = sum(int(c) for c in str(n))
    if ds < 2:
        return False
    for i in range(2, int(ds ** 0.5) + 1):
        if ds % i == 0:
            return False

    return True
1066
1066
Proposer: claude-sonnet-4-6 Solver: claude-haiku-4-5
0 vs 0
#8 Solved
def mystery(x):
    try:
        n = int(x)
    except:
        return False
    
    if n < 100:
        return False
    
    n_squared = n * n
    s_squared = str(n_squared)
    
    # Check if n is a Kaprekar number
    # A Kaprekar number is one where its square can be split into two parts
    # that add up to the original number
    for i in range(1, len(s_squared)):
        left = int(s_squared[:i])
        right = int(s_squared[i:])
        
        if left + right == n:
            return True
    
    return False
297
297
Proposer: claude-haiku-4-5 Solver: claude-sonnet-4-6
0 vs 0
#9 Solved
def mystery(x):
    try:
        n = int(x)
    except:
        return False

    if n <= 1000:
        return False

    # Part A
    lo, hi = 0, n
    while lo < hi:
        mid = (lo + hi + 1) // 2
        if mid * mid <= n:
            lo = mid
        else:
            hi = mid - 1
    if lo * lo != n:
        return False

    p, q = 0, lo
    while p < q:
        mid2 = (p + q + 1) // 2
        if mid2 * mid2 <= lo:
            p = mid2
        else:
            q = mid2 - 1
    if p * p != lo:
        return False

    # Part B
    s = str(n)
    acc = 0
    for c in s:
        acc += int(c)
    if acc % len(s) != 0:
        return False

    # Part C
    b = bin(n)[2:]
    bl = len(b)
    if bl < 2:
        return False
    is_prime = True
    for i in range(2, int(bl**0.5) + 1):
        if bl % i == 0:
            is_prime = False
            break
    if not is_prime:
        return False

    return True
65536
65536
Proposer: claude-sonnet-4-6 Solver: claude-haiku-4-5
0 vs 0
#10 Solved
def mystery(x):
    try:
        n = int(x)
    except:
        return False
    
    if n <= 500:
        return False
    
    # Condition A: Binary representation has equal number of 1s and 0s
    b = bin(n)[2:]  # Remove '0b' prefix
    if b.count('1') != b.count('0'):
        return False
    
    # Condition B: Digit sum (base 10) is even
    digit_sum = sum(int(d) for d in str(n))
    if digit_sum % 2 != 0:
        return False
    
    # Condition C: Divisible by 8
    if n % 8 != 0:
        return False
    
    return True
992
992
Proposer: claude-haiku-4-5 Solver: claude-sonnet-4-6
0 vs 0