conjecscore
Login Sign up

Leaderboard

Taxicab(5, 2, n)

The Problem

Does there exist distinct \(a, b, c, d\) such that \(a^5 + b^5 = c^5 + d^5\)?

Submission Format

Please submit a CSV file that contains \(4\) numbers between \(1\) and \(10^{20}\). \(a\) and \(b\) are the first two numbers and \(c\) and \(d\) are the second two numbers.

Let \(L = (a, b, c, d), x = a^5 + b^5, y = c^5 + d^5, M = \max\{x, y\}\) and \(m = \min\{x, y\}\) The goal is to minimize the following score function: $$\mathsf{score}(L) := \frac{M - m}{\log(\mathsf{mean}(x,y))\mathsf{Var}\{L\}} \times 10^6$$

Score Implementation

The following is a Python implementation of the score function to help you get started.


from math import log
from statistics import mean, pvariance


def score(nums: list[int]):
    # Ensure there are no duplicate numbers
    if len(nums) != len(set(nums)):
        return None
    # Ensure 4 numbers are supplied.
    if len(nums) != 4:
        return None
    # Ensure numbers are positive.
    for num in nums:
        if num <= 0 or num >= 10 ** 20:
            return None

    a, b, c, d = nums
    lhs = a ** 5 + b ** 5
    rhs = c ** 5 + d ** 5
    M = max(lhs, rhs)
    m = min(lhs, rhs)
    me = mean([lhs, rhs])
    var = pvariance(nums)
    return int((M - m) / (log(me) * var) * 10 ** 6)