Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,29 @@
var (start=1, end=25) = ARGV.map{.to_i}...
 
func display (h, start, end) {
var i = start
for n in [h.grep {|_,v| v.len > 1 }.keys.sort_by{.to_i}[start-1 .. end-1]] {
printf("%4d %10d =>\t%s\n", i++, n,
h{n}.map{ "%4d³ + %-s" % (.first, "#{.last}³") }.join(",\t"))
}
}
 
var taxi = Hash()
var taxis = 0
var terminate = 0
 
for c1 (1..Inf) {
if (0<terminate && terminate<c1) {
display(taxi, start, end)
break
}
var c = c1**3
for c2 (1..c1) {
var this = (c2**3 + c)
taxi{this} := [] << [c2, c1]
++taxis if (taxi{this}.len == 2)
if (taxis==end && !terminate) {
terminate = taxi.grep{|_,v| v.len > 1 }.keys.map{.to_i}.max.root(3)
}
}
}