# Find the smallest positive integer that can be written as the sum of three cubes of positive integers in two different ways

Find the smallest positive integer that can be written as the sum of three cubes of positive integers in two different ways. Two ways of summing cubes $$a_1^3 + a_2^3 + a_3^3$$ and $$b_1^3 + b_2^3 + b_3^3$$ are considered different if the multisets $$\{a_1,a_2,a_3\}$$ and $$\{b_1,b_2,b_3\}$$ are not the same.

For convenience, define set $$TA(a,b,c)$$ to be the set of positive integers that can be expressed as the sum of the ath powers of b integers in two different ways, where one of the sums only uses the first c ath powers. We'll only use $$TA(3,3,k) for k = 1,2,3,4,5.$$ Note that by definition, $$TA(3,3,j)$$ is a subset of $$TA(3,3,k)$$ for any $$1 \leq j \leq k.$$ clearly it is impossible to get two different representations using just 1. If we use $$x > 0$$ 8's and $$3-x$$ 1's, then the number of eights is uniquely determined since the resulting number will equal a number in base 8 with digits 0,1,2, or 3 and base 8 representations are unique. Now suppose we can get two different representations using the first 3 cubes. Then if we have three 27's, the representation is unique using only the first 3 cubes and if 64 is used in another representation, then the other two cubes must sum to 81-64=17, which is impossible. If we have 2 27's, the sum is at least 54+1 = 55. The other representation must use two 27's and hence cannot exist as otherwise the sum would be at most 8 * 2 + 27 = 43, a contradiction. If we have one 27, then the sum is at least 27+2 = 29. Any representation must use one 27 as otherwise it would have sum at most $$8\cdot 3 = 24.$$ Hence there are no integers that can be expressed in two different ways as a sum of three cubes, one of which only consists of the first 3 cubes. Finally, we consider the first four cubes. Suppose we have a number that can be expressed as a sum of three cubes in 2 different ways, one of which involves only the first 4 cubes. If 64 is included 3 times in one sum, then the other sum cannot include 125 because i. So the other sum must have 3 64's, a contradiction. If 64 is included 2 times in one sum, then 125 cannot be in the other sum since the remaining two cubes in the other sum would then sum to 3. Also the other sum must have 2 64's as otherwise it would be less than 128. So 64 has to be included once. Then in the other sum, if 64 is not included, the other sum will either be 27 * 3 = 81 or at most 62< 64, a contradiction. Hence the claim in the first part of the proof holds. Now by the above proof, if n is in TA(3,3,5), then n cannot be in TA(3,3,4), so the smallest number that can be expressed as the sum of three perfect cubes in two different ways must satisfy that both ways include a cube exceeding 64. We just need to prove that the smallest element in TA(3,3,5) is 251, since any number n in TA(3,3,i) for some i > 5 and not in TA(3,3,5) must include a 7^3 and exceed 251 or if it is expressed as a sum of three cubes, that sum must include a 6^3. Suppose for a contradiction that $$n \leq 251.$$ Then in any sum of three cubes that equals n, by assumption, we must have a 6^3. But then we have a sum $$a^3 + b^3 = c^3 + d^3 \leq 35$$ with $$\{a,b\} \neq \{c,d\}.$$ There are no solutions to this equation by claim 1 below, since $$a,b,c,d \leq 3.$$ Note: it turns out that TA(3,3,5) only contains 251, though that's unimportant. We claim that the smallest number in TA(3,3,5) is $$5^3 + 5^3 +1 = 251.$$ Let $$a^3 + b^3 +c^3 = d^3 + e^3 + f^3$$ be the two sums of n, where $$a,b,c \leq 5,$$ let A denote the multiset $$\{a^3,b^3,c^3\}$$ and let B denote the multiset $$\{d^3,e^3,f^3\}$$. For a subset X of positive integers, let S(X) denote its sum. B cannot include 7^3 as then the first sum would have to use 3 5^3's or it would be too small. B cannot include two 6^3's as otherwise the first sum would be at most 375 < 432. So assume B includes a 6^3 and thus exceeds 216. The multiset A must have at least 2 5^3's as otherwise S(A) = $$125 + 64 + 64 = 253$$ or S(X) is at most $$125 + 64 + 27 = 216.$$ Now if A has at least 2 125's, then $$S(A) \ge 2 \cdot 125 + 1 = 251,$$ which actually works because it equals $$6^3 + 3^3 + 2^3.$$ We now just need to show that B cannot only have elements in {1,8,27,64,125}, and this will show that 251 is the smallest element of TA(3,3,5). Then if A or B uses two 5^3's, so must the other, contradicting the fact that they differ. If one sum uses one 5^3, the other must also use one 5^3 (otherwise it would be too large if 2 125's were used and from above, at least one 125 must be used). So by subtracting 125 from both sides, we get an equality of the form a^3+ b^3 = c^3 + d^3 where all of a,b,c,d are at most 4 and $$\{a,b\} \neq \{c,d\}.$$ Claim 1: we claim that there do not exist positive integers a,b,c,d so that $$a^3+ b^3 = c^3 + d^3$$ where all of a,b,c,d are at most 4 and $$\{a,b\} \neq \{c,d\}.$$  If a or b = 4, then c or d must also equal 4 as otherwise the RHS would be too small. Hence the distinctness of the solutions is violated. Thus a and b must be at most 3. But then the same applies to c and d. If a or b = 3, then c or d = 3 as otherwise the RHS would be too small. Hence again the assertion {a,b}={c,d} is violated. Finally, $$a, b \leq 2,$$ so $$c,d \leq 2$$ and  $$\{a,b\} \neq \{c,d\}$$ contradicts the uniqueness of the base 8 representation. Thus, $$TA(3,3,5) = \{251\}.$$

Is there a simpler solution that doesn't involve too many computations?

• Those numbers are called taxi-cab numbers. It is not known whether for $k\ge 5$ , the Diophantine equation $$a^k+b^k=c^k+d^k$$ has a nontrivial solution. Commented Dec 8, 2022 at 17:11
• math.stackexchange.com/questions/107570/… Commented Dec 8, 2022 at 18:07

Suppose there exists a non-trivial solution in positive integers of:

$$\qquad a_1^3 + a_2^3 + a_3^3 = b_1^3 + b_2^3 + b_3^3 \qquad(1)$$

with the common total < 251. Clearly we are limited to the integers $$1,2,\dots,6$$ since $$7^3 = 343 > 251$$.

We use the well-known fact that the smallest integer expressible in two ways as a sum of two cubes of positive integers is $$1729$$. Hence we cannot have $$a_i = b_j$$ for any $$i,j$$, otherwise the remaining two sums of cubes would be equal and the common total would be $$> 1729$$. (A)

The cubic residues of $$1,2,\dots,6 \pmod 7$$ are respectively $$1,1,6,1,6,6$$. The only sums that can be formed of three of these residues $$\pmod 7$$ are: $$1 + 1 + 1 \equiv3$$; $$1 + 1 + 6 \equiv 1$$; $$1 + 6 + 6 \equiv 6$$; $$6 + 6 + 6 \equiv 4$$. Since $$3, 1, 6, 4$$ are all different, any solution of $$(1)$$ must have the same pattern (up to order) of residues on both sides.

Case 1: Residues on both sides are $${1,1,1}$$ or $${1,1,6}$$

Given (A), and since the cubes of only the three integers $$1,2,4$$ are $$\equiv 1 \pmod 7$$, the cube of at least one of $$1,2,4$$ must be repeated on the same side of $$(1)$$. Also, the other side must contain two cubes of one or both of the remaining two integers in $${1,2,4}$$. This yields six sub-cases to be considered:

$$\qquad 1^3 + 1^3 + a^3 = 2^3 + 4^3 + b^3$$ requiring $$a^3 – b^3 = 70$$

$$\qquad 2^3 + 2^3 + a^3 = 1^3 + 4^3 + b^3$$ requiring $$a^3 – b^3 = 49$$

$$\qquad 4^3 + 4^3 + a^3 = 1^3 + 2^3 + b^3$$ requiring $$a^3 – b^3 = -119$$

$$\qquad 1^3 + 1^3 + a^3 = 2^3 + 2^3 + b^3$$ requiring $$a^3 – b^3 = 14$$

$$\qquad 2^3 + 2^3 + a^3 = 4^3 + 4^3 + b^3$$ requiring $$a^3 – b^3 = 112$$

$$\qquad 4^3 + 4^3 + a^3 = 1^3 + 1^3 + b^3$$ requiring $$a^3 – b^3 = -126$$

The remaining two cubes $$a^3, b^3$$ must either be both $$\equiv 1$$ or both $$\equiv 6 \pmod 7$$. In the former sub-case (cubes of $$1,2,4$$) the possible values of $$a^3 – b^3$$ are $$\pm7$$, $$\pm63$$, $$\pm56$$, and in the latter sub-case (cubes of $$3,5,6$$) the possible values are $$\pm98$$, $$\pm189$$, $$\pm91$$. None of these match any of the required values, so this case is impossible.

Case 2: Residues on both sides are $${1,6,6}$$ or $${6,6,6}$$.

Given (A), and since the cubes of only the three integers $$3,5,6$$ are $$\equiv 6 \pmod 7$$, the cube of at least one of those integers must be repeated on the same side of $$(1)$$. The same method as Case 1 could be followed, but it is quicker to note that if that side has $$2 \times 5^3 = 250$$ or $$2 \times 6^3 = 432$$ the common total must be $$\geq 251$$. Also, if that side has $$2 \times 3^3$$ then the other side must contain either $$2 \times 5^3$$ or $$2 \times 6^3$$ or $$5^3 + 6^3$$, in each case implying a total $$\geq 251$$. So Case 2 cannot yield a common total $$< 251$$.

Hence $$251$$ is the lowest possible common total.

• Thanks. Could you share the least computationally intensive proof you know of for the well-known fact that 1729 is the smallest positive integer that can be expressed as the sum of two (positive) cubes in two different ways? Commented Dec 15, 2022 at 23:58
• @user33096 In outline, any pair of equal sums of two cubes can be rearranged as a pair of equal differences of two cubes. Considerations of odd-even parity imply that the pairs of differences can always be chosen so that members of any one difference are of the same parity. So it is only necessary to consider differences between cubes of odd integers not exceeding $11$ (15 cases) and differences between cubes of even integers not exceeding $10$ (10 cases), and then note that none of these differences are equal. Commented Dec 16, 2022 at 12:35