/- Copyright 2026 The Formal Conjectures Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ import FormalConjecturesUtil

Taxicab numbers

A taxicab number for natural numbers $k, m, n$ is the smallest number $x$ that can be expressed as a sum of $m$ positive $k$-th powers in at least $n$ distinct ways. The most famous taxicab number is $ 1729 = 1³ + 12³ = 9³ + 10³, $ also known as the Hardy–Ramanujan number.

However, a taxicab number is not known for $k=5$, $m=2$, and any $n ≥ 2$: No positive integer is known that can be written as the sum of two 5th powers in more than one way, and it is not known whether such a number exists.

In particular, it is not known whether there exists a taxicab number for $k=5$, $m=2$, and $n=2$.

References:

namespace Taxicab

$x$ is a candidate for being a taxicab number for $k, m, n$ if there exists a (finite) set of at least $n$ distinct, pairwise disjoint, non-empty, non-zero lists of length $m$, such that the sum of the $k$-th powers of the elements of each list is $x$. The disjointness condition ensures that the representations do not share any common terms.

def IsTaxicabFor' (k m n x : ) : Prop := (S : Finset (List )), S.card n L S, M S, L M List.Disjoint L M ( L S, L.length = m L [] 0 L (L.map (· ^ k)).sum = x)

$1729$ is a possible taxicab number for $k=3, m=2, n=2$.

@[category test, AMS 11] theorem taxicab_1729 : IsTaxicabFor' 3 2 2 1729 := IsTaxicabFor' 3 2 2 1729 {{1, 12}, {9, 10}}.card 2 L {{1, 12}, {9, 10}}, M {{1, 12}, {9, 10}}, L M L.Disjoint M L {{1, 12}, {9, 10}}, L.length = 2 L [] 0 L (List.map (fun x => x ^ 3) L).sum = 1729 2 {{1, 12}, {9, 10}}.card (¬{1, 12} = {9, 10} (∀ a : ⦄, a {1, 12} a {9, 10}) ({1, 12}.length = 2 ¬{1, 12} = [] 0 {1, 12} (List.map (fun x => x ^ 3) {1, 12}).sum = 1729) {9, 10}.length = 2 ¬{9, 10} = [] 0 {9, 10} (List.map (fun x => x ^ 3) {9, 10}).sum = 1729) (¬{9, 10} = {1, 12} (∀ a : ⦄, a {9, 10} a {1, 12}) ({1, 12}.length = 2 ¬{1, 12} = [] 0 {1, 12} (List.map (fun x => x ^ 3) {1, 12}).sum = 1729) {9, 10}.length = 2 ¬{9, 10} = [] 0 {9, 10} (List.map (fun x => x ^ 3) {9, 10}).sum = 1729) All goals completed! 🐙

$x$ is a taxicab number if it is the smallest number that can be expressed as a sum of $m$ positive $k$-th powers in at least $n$ distinct ways.

def IsTaxicabFor (k m n : ) (x : ) : Prop := IsLeast { x : | IsTaxicabFor' k m n x } x @[category test, AMS 11] theorem taxicab_4' : IsTaxicabFor' 1 2 2 4 := IsTaxicabFor' 1 2 2 4 {[1, 3], [2, 2]}.card 2 L {[1, 3], [2, 2]}, M {[1, 3], [2, 2]}, L M L.Disjoint M L {[1, 3], [2, 2]}, L.length = 2 L [] 0 L (List.map (fun x => x ^ 1) L).sum = 4 All goals completed! 🐙

Using Aristotle (Harmonic) we get a compact proof that 4 is the taxicab number for $k=1, m=2, n=2$.

@[category test, AMS 11] theorem taxicab_4 : IsTaxicabFor 1 2 2 4 := IsTaxicabFor 1 2 2 4 4 {x | IsTaxicabFor' 1 2 2 x}4 lowerBounds {x | IsTaxicabFor' 1 2 2 x} 4 {x | IsTaxicabFor' 1 2 2 x} All goals completed! 🐙 4 lowerBounds {x | IsTaxicabFor' 1 2 2 x} x:S:Finset (List )hS₁:S.card 2hS₂: L S, M S, L M L.Disjoint M L S, L.length = 2 L [] 0 L (List.map (fun x => x ^ 1) L).sum = x4 x x:S:Finset (List )hS₁:S.card 2hS₂: L S, M S, L M L.Disjoint M L S, L.length = 2 L [] 0 L (List.map (fun x => x ^ 1) L).sum = xs:List hs:s St:List ht:t Shst:s t4 x x:S:Finset (List )hS₁:S.card 2hS₂: L S, M S, L M L.Disjoint M L S, L.length = 2 L [] 0 L (List.map (fun x => x ^ 1) L).sum = xs:List hs:s St:List ht:t Shst:s tthis:s.Disjoint t L S, L.length = 2 L [] 0 L (List.map (fun x => x ^ 1) L).sum = x := hS₂ s hs t ht hst4 x x:S:Finset (List )hS₁:S.card 2hS₂: L S, M S, L M L.Disjoint M L S, L.length = 2 L [] 0 L (List.map (fun x => x ^ 1) L).sum = xs:List hs:s St:List ht:t Shst:s th₁:s.Disjoint th₂: L S, L.length = 2 L [] 0 L (List.map (fun x => x ^ 1) L).sum = x4 x x:S:Finset (List )hS₁:S.card 2hS₂: L S, M S, L M L.Disjoint M L S, L.length = 2 L [] 0 L (List.map (fun x => x ^ 1) L).sum = xs:List hs:s St:List ht:t Shst:s th₁:s.Disjoint th₂:s.length = 2 s [] 0 s (List.map (fun x => x ^ 1) s).sum = x4 x x:S:Finset (List )hS₁:S.card 2hS₂: L S, M S, L M L.Disjoint M L S, L.length = 2 L [] 0 L (List.map (fun x => x ^ 1) L).sum = xt:List ht:t Shs:[] Shst:[] th₁:[].Disjoint th₂:[].length = 2 [] [] 0 [] (List.map (fun x => x ^ 1) []).sum = x4 xx:S:Finset (List )hS₁:S.card 2hS₂: L S, M S, L M L.Disjoint M L S, L.length = 2 L [] 0 L (List.map (fun x => x ^ 1) L).sum = xt:List ht:t Sa:hs:[a] Shst:[a] th₁:[a].Disjoint th₂:[a].length = 2 [a] [] 0 [a] (List.map (fun x => x ^ 1) [a]).sum = x4 xx:S:Finset (List )hS₁:S.card 2hS₂: L S, M S, L M L.Disjoint M L S, L.length = 2 L [] 0 L (List.map (fun x => x ^ 1) L).sum = xt:List ht:t Sa:b:hs:[a, b] Shst:[a, b] th₁:[a, b].Disjoint th₂:[a, b].length = 2 [a, b] [] 0 [a, b] (List.map (fun x => x ^ 1) [a, b]).sum = x4 xx:S:Finset (List )hS₁:S.card 2hS₂: L S, M S, L M L.Disjoint M L S, L.length = 2 L [] 0 L (List.map (fun x => x ^ 1) L).sum = xt:List ht:t Sa:b:s:tail✝:List hs:a :: b :: s :: tail✝ Shst:a :: b :: s :: tail✝ th₁:(a :: b :: s :: tail✝).Disjoint th₂:(a :: b :: s :: tail✝).length = 2 a :: b :: s :: tail✝ [] 0 a :: b :: s :: tail✝ (List.map (fun x => x ^ 1) (a :: b :: s :: tail✝)).sum = x4 x x:S:Finset (List )hS₁:S.card 2hS₂: L S, M S, L M L.Disjoint M L S, L.length = 2 L [] 0 L (List.map (fun x => x ^ 1) L).sum = xt:List ht:t Shs:[] Shst:[] th₁:[].Disjoint th₂:[].length = 2 [] [] 0 [] (List.map (fun x => x ^ 1) []).sum = x4 xx:S:Finset (List )hS₁:S.card 2hS₂: L S, M S, L M L.Disjoint M L S, L.length = 2 L [] 0 L (List.map (fun x => x ^ 1) L).sum = xt:List ht:t Sa:hs:[a] Shst:[a] th₁:[a].Disjoint th₂:[a].length = 2 [a] [] 0 [a] (List.map (fun x => x ^ 1) [a]).sum = x4 xx:S:Finset (List )hS₁:S.card 2hS₂: L S, M S, L M L.Disjoint M L S, L.length = 2 L [] 0 L (List.map (fun x => x ^ 1) L).sum = xt:List ht:t Sa:b:hs:[a, b] Shst:[a, b] th₁:[a, b].Disjoint th₂:[a, b].length = 2 [a, b] [] 0 [a, b] (List.map (fun x => x ^ 1) [a, b]).sum = x4 xx:S:Finset (List )hS₁:S.card 2hS₂: L S, M S, L M L.Disjoint M L S, L.length = 2 L [] 0 L (List.map (fun x => x ^ 1) L).sum = xt:List ht:t Sa:b:s:tail✝:List hs:a :: b :: s :: tail✝ Shst:a :: b :: s :: tail✝ th₁:(a :: b :: s :: tail✝).Disjoint th₂:(a :: b :: s :: tail✝).length = 2 a :: b :: s :: tail✝ [] 0 a :: b :: s :: tail✝ (List.map (fun x => x ^ 1) (a :: b :: s :: tail✝)).sum = x4 x All goals completed! 🐙 x:S:Finset (List )a:b:hS₁:2 S.cardhS₂: L S, M S, ¬L = M L.Disjoint M L S, L.length = 2 ¬L = [] 0 L L.sum = xhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xht:[] Shst:¬[a, b] = []4 xx:S:Finset (List )a:b:hS₁:2 S.cardhS₂: L S, M S, ¬L = M L.Disjoint M L S, L.length = 2 ¬L = [] 0 L L.sum = xhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xc:ht:[c] Shst:¬[a, b] = [c]4 xx:S:Finset (List )a:b:hS₁:2 S.cardhS₂: L S, M S, ¬L = M L.Disjoint M L S, L.length = 2 ¬L = [] 0 L L.sum = xhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xc:d:ht:[c, d] Shst:¬[a, b] = [c, d]4 xx:S:Finset (List )a:b:hS₁:2 S.cardhS₂: L S, M S, ¬L = M L.Disjoint M L S, L.length = 2 ¬L = [] 0 L L.sum = xhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xc:d:t:tail✝:List ht:c :: d :: t :: tail✝ Shst:¬[a, b] = c :: d :: t :: tail✝4 x x:S:Finset (List )a:b:hS₁:2 S.cardhS₂: L S, M S, ¬L = M L.Disjoint M L S, L.length = 2 ¬L = [] 0 L L.sum = xhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xht:[] Shst:¬[a, b] = []4 xx:S:Finset (List )a:b:hS₁:2 S.cardhS₂: L S, M S, ¬L = M L.Disjoint M L S, L.length = 2 ¬L = [] 0 L L.sum = xhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xc:ht:[c] Shst:¬[a, b] = [c]4 xx:S:Finset (List )a:b:hS₁:2 S.cardhS₂: L S, M S, ¬L = M L.Disjoint M L S, L.length = 2 ¬L = [] 0 L L.sum = xhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xc:d:ht:[c, d] Shst:¬[a, b] = [c, d]4 xx:S:Finset (List )a:b:hS₁:2 S.cardhS₂: L S, M S, ¬L = M L.Disjoint M L S, L.length = 2 ¬L = [] 0 L L.sum = xhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xc:d:t:tail✝:List ht:c :: d :: t :: tail✝ Shst:¬[a, b] = c :: d :: t :: tail✝4 x x:S:Finset (List )a:b:hS₁:2 S.cardhS₂: L S, M S, ¬L = M L.Disjoint M L S, L.length = 2 ¬L = [] 0 L L.sum = xhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xc:d:t:tail✝:List ht:c :: d :: t :: tail✝ S4 x x:S:Finset (List )a:b:hS₁:2 S.cardhS₂: L S, M S, ¬L = M L.Disjoint M L S, L.length = 2 ¬L = [] 0 L L.sum = xhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xht:[] S4 x All goals completed! 🐙 x:S:Finset (List )a:b:hS₁:2 S.cardhS₂: L S, M S, ¬L = M L.Disjoint M L S, L.length = 2 ¬L = [] 0 L L.sum = xhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xc:ht:[c] S4 x x:S:Finset (List )a:b:hS₁:2 S.cardhS₂: L S, M S, ¬L = M L.Disjoint M L S, L.length = 2 ¬L = [] 0 L L.sum = xhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xc:ht:[c] Sthis:¬[c] = [a, b] [c].Disjoint [a, b] L S, L.length = 2 ¬L = [] 0 L L.sum = x := hS₂ [c] ht [a, b] hs4 x x:S:Finset (List )a:b:hS₁:2 S.cardc:hS₂: L S, M S, ¬L = M L.Disjoint Mhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xht:[c] Sthis:(¬c = a ¬c = b) L S, L.length = 2 ¬L = [] 0 L L.sum = x4 x All goals completed! 🐙 x:S:Finset (List )a:b:hS₁:2 S.cardhS₂: L S, M S, ¬L = M L.Disjoint M L S, L.length = 2 ¬L = [] 0 L L.sum = xhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xc:d:ht:[c, d] Shst:a = c ¬b = d4 x x:S:Finset (List )a:b:hS₁:2 S.cardhS₂: L S, M S, ¬L = M L.Disjoint M L S, L.length = 2 ¬L = [] 0 L L.sum = xhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xc:d:ht:[c, d] Shst:a = c ¬b = dthis:¬[a, b] = [c, d] [a, b].Disjoint [c, d] L S, L.length = 2 ¬L = [] 0 L L.sum = x := hS₂ [a, b] hs [c, d] ht4 x x:S:Finset (List )a:b:hS₁:2 S.cardc:d:hS₂: L S, M S, ¬L = M a : ⦄, a L a Mhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xht:[c, d] Sthis:((¬a = c ¬a = d) ¬b = c ¬b = d) L S, L.length = 2 ¬L = [] 0 L L.sum = x4 x x:S:Finset (List )a:b:hS₁:2 S.cardc:d:hS₂: L S, M S, ¬L = M a : ⦄, a L a Mhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xht:[c, d] Sthis✝:((¬a = c ¬a = d) ¬b = c ¬b = d) L S, L.length = 2 ¬L = [] 0 L L.sum = xthis:[a, b].length = 2 ¬[a, b] = [] 0 [a, b] [a, b].sum = x := this✝.right [a, b] hs4 x x:S:Finset (List )a:b:hS₁:2 S.cardc:d:hS₂: L S, M S, ¬L = M a : ⦄, a L a Mhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xht:[c, d] Sthis✝¹:((¬a = c ¬a = d) ¬b = c ¬b = d) L S, L.length = 2 ¬L = [] 0 L L.sum = xthis✝:[a, b].length = 2 ¬[a, b] = [] 0 [a, b] [a, b].sum = x := this✝.right [a, b] hsthis:0 [a, b] [a, b].sum = x := this✝.right.right4 x x:S:Finset (List )a:b:hS₁:2 S.cardc:d:hS₂: L S, M S, ¬L = M a : ⦄, a L a Mhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xht:[c, d] Sthis:((¬a = c ¬a = d) ¬b = c ¬b = d) L S, L.length = 2 ¬L = [] 0 L L.sum = x4 x All goals completed! 🐙 x:S:Finset (List )a:b:hS₁:2 S.cardhS₂: L S, M S, ¬L = M L.Disjoint M L S, L.length = 2 ¬L = [] 0 L L.sum = xhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xc:d:t:tail✝:List ht:c :: d :: t :: tail✝ S4 x x:S:Finset (List )a:b:hS₁:2 S.cardhS₂: L S, M S, ¬L = M L.Disjoint M L S, L.length = 2 ¬L = [] 0 L L.sum = xhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xc:d:t:tail✝:List ht:c :: d :: t :: tail✝ Sthis:¬[a, b] = c :: d :: t :: tail✝ [a, b].Disjoint (c :: d :: t :: tail✝) L S, L.length = 2 ¬L = [] 0 L L.sum = x := hS₂ [a, b] hs (c :: d :: t :: tail✝) ht4 x x:S:Finset (List )a:b:hS₁:2 S.cardc:d:t:tail✝:List hS₂: L S, M S, ¬L = M a : ⦄, a L a Mhs:[a, b] Sh₂:(¬0 = a ¬0 = b) a + b = xht:c :: d :: t :: tail✝ Sthis:((¬a = c ¬a = d ¬a = t a tail✝) ¬b = c ¬b = d ¬b = t b tail✝) L S, L.length = 2 ¬L = [] 0 L L.sum = x4 x All goals completed! 🐙

Taxicab number for $k=5$, $m=2$, and $n=2$ is not known. Whether such a number exists is also not known.

@[category research open, AMS 11] theorem declaration uses 'sorry'taxicab_for_5_2_2 : answer(sorry) x : , IsTaxicabFor 5 2 2 x := True x, IsTaxicabFor 5 2 2 x All goals completed! 🐙

Taxicab number for $k=5$ and $m=2$ is not-known for any $n ≥ 2$. Whether such a number exists is also not known.

@[category research open, AMS 11] theorem declaration uses 'sorry'taxicab_for_5_2_n : answer(sorry) n : , n 2 ( x : , IsTaxicabFor 5 2 n x) := True n 2, x, IsTaxicabFor 5 2 n x All goals completed! 🐙 end Taxicab