0
$\begingroup$

I resolve this question by using kinds of iteration approach of subset sum (https://en.wikipedia.org/wiki/Subset_sum_problem), show my code below in Python 2.7. Wondering if any pure mathematical solution?

Source code in Python 2.7,

'''
# Print all integers that can be obtained as
# the sum of cubes of 2 distinct pairs of integers.

# Example: 12 pow 3 + 1 pow 3 =  1729 = 10 pow 3 + 9 pow 3


# x * x * x + y * y * y = num
# k * k * k + z * z * z = num

# (x,y) != (k, z) != (y, x)
'''
def two_sum(numbers, target):
    r = 0
    i = 0
    j = len(numbers) - 1
    while i target:
            j -= 1
        else:
            i += 1
    return r

def find_number():
    cube_numbers = []
    result = []
    for i in range(100):
        cube_numbers.append(i*i*i)
    for i in range(1, 10001):
        r = two_sum(cube_numbers, i)
        if r == 2:
            result.append(i)
    return result

if __name__ == "__main__":
    print find_number()
  • 1
    Why? There is a parameterization of this equation. http://math.stackexchange.com/questions/469151/find-all-integer-solutions-to-diophantine-equation-x3y3z3-w32017-02-12
  • 0
    @individ, I think my question is different. I am working on two cubic number case, but you referred post is for 3 or 4 cubic number case. If you have any advice on my original question, it will be great.2017-02-13

0 Answers 0