中尾です。

このような数は、RamanujanのTaxicab数と呼ばれています。

Ramanujan Taxi Numbers [1..1000000000]
[0:2]1^3+12^3=9^3+10^3=1729
[1:2]2^3+16^3=9^3+15^3=4104
[2:2]10^3+27^3=19^3+24^3=20683
[3:2]2^3+34^3=15^3+33^3=39312
[4:2]9^3+34^3=16^3+33^3=40033
[5:2]17^3+39^3=26^3+36^3=64232
[6:2]12^3+40^3=31^3+33^3=65728
[7:2]12^3+51^3=38^3+43^3=134379
[8:2]8^3+53^3=29^3+50^3=149389
[9:2]17^3+55^3=24^3+54^3=171288
[10:2]9^3+58^3=22^3+57^3=195841
[11:2]3^3+60^3=22^3+59^3=216027
[12:2]30^3+67^3=51^3+58^3=327763
[13:2]42^3+69^3=56^3+61^3=402597
[14:2]5^3+76^3=48^3+69^3=439101
[15:2]17^3+76^3=38^3+73^3=443889
[16:2]15^3+80^3=54^3+71^3=515375
[17:2]51^3+82^3=64^3+75^3=684019
[18:2]2^3+89^3=41^3+86^3=704977
[19:2]11^3+93^3=30^3+92^3=805688
[20:2]23^3+94^3=63^3+84^3=842751
[21:2]20^3+97^3=33^3+96^3=920673
[22:2]24^3+98^3=63^3+89^3=955016
[23:2]35^3+98^3=59^3+92^3=984067
[24:2]29^3+99^3=60^3+92^3=994688
[25:2]50^3+96^3=59^3+93^3=1009736
[26:2]47^3+97^3=66^3+90^3=1016496
[27:2]23^3+102^3=60^3+95^3=1073375
[28:2]1^3+103^3=64^3+94^3=1092728
[29:2]4^3+110^3=67^3+101^3=1331064
[30:2]62^3+109^3=90^3+93^3=1533357
[31:2]55^3+113^3=92^3+94^3=1609272
[32:2]42^3+121^3=49^3+120^3=1845649
[33:2]2^3+127^3=95^3+106^3=2048391
[34:2]23^3+134^3=95^3+116^3=2418271
[35:2]18^3+139^3=94^3+123^3=2691451
[36:2]10^3+142^3=103^3+121^3=2864288
[37:2]76^3+141^3=85^3+138^3=3242197
[38:2]1^3+150^3=73^3+144^3=3375001
[39:2]2^3+150^3=83^3+141^3=3375008
[40:2]4^3+152^3=41^3+151^3=3511872
[41:2]18^3+153^3=121^3+122^3=3587409
[42:2]26^3+156^3=123^3+125^3=3813992
[43:2]10^3+161^3=84^3+153^3=4174281
[44:2]23^3+163^3=121^3+137^3=4342914
[45:2]24^3+165^3=86^3+157^3=4505949
[46:2]27^3+165^3=100^3+152^3=4511808
[47:2]32^3+166^3=129^3+135^3=4607064
[48:2]25^3+167^3=64^3+164^3=4673088
[49:2]76^3+165^3=102^3+157^3=4931101
[50:2]36^3+172^3=93^3+163^3=5135104
[51:2]37^3+174^3=136^3+141^3=5318677
[52:2]71^3+172^3=135^3+144^3=5446359
[53:2]51^3+178^3=115^3+162^3=5772403
[54:2]40^3+179^3=107^3+166^3=5799339
[55:2]72^3+178^3=115^3+165^3=6013000
[56:2]57^3+180^3=113^3+166^3=6017193
[57:2]99^3+172^3=120^3+163^3=6058747
[58:2]10^3+184^3=67^3+181^3=6230504
[59:2]3^3+186^3=59^3+184^3=6434883
[60:2]66^3+184^3=105^3+175^3=6517000
[61:2]45^3+196^3=133^3+174^3=7620661
[62:2]93^3+192^3=149^3+166^3=7882245
[63:2]32^3+202^3=129^3+183^3=8275176
[64:2]15^3+204^3=79^3+200^3=8493039
[65:2]14^3+207^3=140^3+183^3=8872487
[66:2]9^3+210^3=161^3+172^3=9261729
[67:2]68^3+209^3=146^3+185^3=9443761
[68:2]72^3+213^3=109^3+206^3=10036845
[69:2]50^3+216^3=167^3+177^3=10202696
[70:2]40^3+218^3=101^3+211^3=10424232
[71:2]81^3+215^3=120^3+206^3=10469816
[72:2]135^3+202^3=166^3+183^3=10702783
[73:2]64^3+219^3=163^3+186^3=10765603
[74:2]84^3+217^3=145^3+198^3=10811017
[75:2]116^3+210^3=147^3+197^3=10821896
[76:2]20^3+223^3=159^3+192^3=11097567
[77:2]73^3+223^3=94^3+220^3=11478584
[78:2]17^3+226^3=54^3+225^3=11548089
[79:2]24^3+226^3=55^3+225^3=11557000
[80:2]10^3+233^3=108^3+225^3=12650337
[81:2]47^3+233^3=176^3+194^3=12753160
[82:2]80^3+235^3=171^3+204^3=13489875
[83:2]21^3+238^3=114^3+229^3=13490533
[84:2]121^3+228^3=186^3+193^3=13623913
[85:2]87^3+240^3=94^3+239^3=14482503
[86:2]31^3+246^3=103^3+240^3=14916727
[87:2]45^3+246^3=173^3+214^3=14978061
[88:2]156^3+225^3=169^3+218^3=15187041
[89:2]68^3+246^3=185^3+207^3=15201368
[90:2]80^3+246^3=179^3+213^3=15398936
[91:2]1^3+249^3=135^3+235^3=15438250
[92:2]119^3+241^3=168^3+222^3=15682680
[93:2]5^3+254^3=197^3+206^3=16387189
[94:2]18^3+255^3=151^3+236^3=16587207
[95:2]58^3+255^3=183^3+220^3=16776487
[96:2]21^3+257^3=167^3+231^3=16983854
[97:2]87^3+254^3=191^3+216^3=17045567
[98:2]146^3+246^3=207^3+209^3=17999072
[99:2]19^3+264^3=75^3+262^3=18406603
[100:2]20^3+265^3=118^3+257^3=18617625
....以下省略....

プログラムは以下の通りです。
-------------ここから--------------------------------------------
#!/usr/local/bin/ruby -K
# rtaxi.rb
#
# Find Ramanujan Texicab Numbers  n
#   such that for some a,b,c,d \in N, a < c < d < b, n = a^3+b^3=c^3+d^3 .
#
class Integer
def p3 # self^3
self ** 3
end

def icuberoot # [self^(1/3)]
upper = self
lower = 1
while upper-lower > 1 do
mid = (upper+lower)/2
if mid.p3 > self
upper = mid
else
lower = mid
end
end
lower
end

def gcd(m)   # gcd{self,m}
if m == 0 or self == m then
self
else
if self >= m then
p = m
m = self % m
else
p = self
m = m % self
end

while m != 0 do
t = p
p = m
m = t % m
end
p
end
end

def max(m)   # max{self,m}
if self >= m
self
else
m
end
end

def min(m)   # min{self,m}
if self <= m
self
else
m
end
end
end

class Ramanujan
def initialize
@taxi = Hash.new(nil)
@limu = 1000
@liml = 1
@count = 0
end

# taxi number in [1..n]
def table(n)
@taxi.clear
@limu = n
@liml = 1
@count = 0
ilimu = (@limu-1).icuberoot
(1..ilimu).each do |i|
jlimu = (@limu-i.p3).icuberoot.max(i)
(i..jlimu).each do |j|   # i <= j
k = i.p3 + j.p3
if k <= @limu
if @taxi[k] == nil
@taxi[k] = [i,j]
else
@taxi[k] = @taxi[k]+[i,j]
end
else
break
end
end
end
self
end

# taxi number [m..n]
def table2(m,n)
@taxi.clear
@limu = n
@liml = m
ilimu = (@limu-1).icuberoot
(1..ilimu).each do |i|
jlimu = (@limu-i.p3).icuberoot.max(i)
(i..jlimu).each do |j|   # i <= j
k = i.p3 + j.p3
if k <= @limu && k >= @liml
if @taxi[k] == nil
@taxi[k] = [i,j]
else
@taxi[k] = @taxi[k]+[i,j]
end
else
if k > @limu
break
end
end
end
end
self
end

def count
@count
end

def find  # print @taxi
@taxi.each do |key, value|
len = (value.length)/2
if len >= 2
a = value[0]
b = value[1]
c = value[2]
d = value[3]
g = a.gcd(b).gcd(c).gcd(d)
out = sprintf("%d]%d^3+%d^3=%d^3+%d^3",len,a,b,c,d)
if len >= 3
(2..(len-1)).each do |j|
e = value[2*j]
f = value[2*j+1]
g = g.gcd(e).gcd(f)
out =  out + sprintf("=%d^3+%d^3",e,f)
end
end
if g == 1
@taxi[key] = out
else
# delete (key,value)
@taxi.delete(key)
end
elsif len == 1
# delete (key,value)
@taxi.delete(key)
end
end
self
end

def print  # print @taxi
printf("Ramanujan Taxi Numbers [%d..%d]\n",@liml,@limu)
k = @taxi.keys.sort
i = @count
#     p(k)
#     p(@taxi.values.sort)
k.each do |key|
if @taxi[key] != nil
printf("[%i:%s=%d\n",i,@taxi[key],key)
i = i + 1
end
end
@count = i
self
end

def taxi(n) #[1..n]
self.table(n).find.print
nil
end

def taxip3(n) #[1..n^3]
self.table(n.p3).find.print
nil
end

def taxi2(m,n) #[m..n]
self.table2(m,n).find.print
nil
end

def taxi2p3(m,n) #[m^3..n^3]
self.table2(m.p3,n.p3).find.print
nil
end
end

=begin

n=1000.p3
a=Ramanujan.new
a.taxi(n)

(1..10).each do |i|
a.taxi2(i*n,(i+1)*n)
end

=end
----------------------ここまで----------------------------------

http://www.kaynet.or.jp/~kay/misc/column/ramanujan.html

[1]Joseph H.Silverman, John Tate(著), 足立 恒雄, 木田 雅成, 小松 啓一,

p196-201, 1995, ISBN4-431-70683-6, {3900円}
[2]Alf van der Poorten(著), 山口 周(訳), "フェルマーの最終定理について
のノート", 森北出版, p77-78, 2000, ISBN4-627-06101-3, {3800円}

Shin-ichiro HARA wrote:
>
> 自然数のペアで、３乗の和が等しくなるもののリストを１００個あげて
> ください。
>