# The Mordell-Schinzel conjecture for cubic surfaces # János Kollár, Jennifer Li # Last updated: Sunday, November 24, 2024 # This program, integerTriples.py, computes the integer solutions of the four equations (11.1-11.4) of the paper. # The output consists of triples (x, y, z) where x, y, z are integers. # Here, we define arrays that will store the integer solutions as we find them. eq_1_integer_solutions = [] eq_2_integer_solutions = [] eq_3_integer_solutions = [] eq_4_integer_solutions = [] # We define the four equations (11.1-11.4) here. def eq_1(x, y): if x == 0 or y == 0: return False return (x**3 + y**3 + 1 - x**2 - y**2) / (x * y) def eq_2(x, y): # z = (x**3 + y**3 + 1 -2*x**2 - x - 2*y**2 - y) / (x * y) if x == 0 or y == 0: return False return (x**3 + y**3 + 1 - 2*x**2 - x - 2*y**2 - y) / (x * y) def eq_3(x, y): # z = (x**3 + y**3 + 1 -2x**2 - x - y**2) / (x * y) if x == 0 or y == 0: return False return (x**3 + y**3 + 1 - 2*x**2 - x - y**2) / (x * y) def eq_4(x, y): # z = (x**3 + y**3 + 1 -x**2 - 2*y**2 - y) / (x * y) if x == 0 or y == 0: return False return (x**3 + y**3 + 1 -x**2 - 2*y**2 - y) / (x * y) # This ensures that all integers show up as integers without a decimal (by default, Python will display the integer 1 as 1.0, for example). def show_as_int(set): return tuple(int(num) for num in set) # This prints each solution on a separate line. def print_result(list): for r in list: print(f" * {show_as_int(r)}") # Here we find the integer solutions for the equations (11.1-11.4). # Instead of taking the range |x|, |y| < 100, we take the range |x|, |y| < 1000 (it only takes a little longer). # Each time we find an integer solution, we add it to the appropriate array (there is one array for each of the four equations, defined above). for x in range(-1000, 1000): for y in range(-1000, 1000): z = eq_1(x, y) if z.is_integer() and z != False: eq_1_integer_solutions.append((x,y,z)) z = eq_2(x, y) if z.is_integer() and z != False: eq_2_integer_solutions.append((x,y,z)) z = eq_3(x, y) if z.is_integer() and z != False: eq_3_integer_solutions.append((x,y,z)) z = eq_4(x, y) if z.is_integer() and z != False: eq_4_integer_solutions.append((x,y,z)) # The remaining lines print the integer triples (x, y, z) for each equation. print("Integer triples (x, y, z) for the first equation (11.1):") print_result(eq_1_integer_solutions) print("Integer triples (x, y, z) for the second equation (11.2):") print_result(eq_2_integer_solutions) print("Integer triples (x, y, z) for the third equation (11.3):") print_result(eq_3_integer_solutions) print("Integer triples (x, y, z) for the fourth equation (11.4):") print_result(eq_4_integer_solutions)