What's so great about 1729?

2

This is not a duplicate of this question. This is asking for the nth number that can be represented as the sum of two cubes in two different ways, while that is asking for the n-th number that can be expressed as the sum of two cubes in n ways.

Introduction

I was just watching The man who knew Infinity, and I thought it would make a good challenge.

So, what's the challenge??

You must write a program that will calculate the n-th number that can be expressed as the sum of two cubes, not in one way, but exactly two.

Specifications

  • You may output either the n-th number, or an array up to (and including) the n-th value.
  • You must output both sums of cubes (however you'd like), and the number, for each output.
  • You cannot hardcode any solutions.
  • Runtime will be my Arch Linux laptop with 16 GB of RAM and an Intel i7 processor.
  • Negitive numbers are not used.

Winning

  • The winner is the solution who's runtime for n = 10 (in seconds) times the code size is smallest.

NoOneIsHere

Posted 2016-05-27T02:44:22.077

Reputation: 1 916

Question was closed 2016-05-27T03:30:30.243

@orlp That is asking for the "n-th number that can be expressed as the sum of 2 cubes in n ways", not 2. This is different, albeit similar. – NoOneIsHere – 2016-05-27T02:51:38.023

@orlp "are the least numbers that are able to be represented as n different sums of two positive cubed integers, for successive n." (Bold added by me) – NoOneIsHere – 2016-05-27T02:52:42.730

Does it have to be exactly two ways and no more, or at least two ways? What about negative numbers? – orlp – 2016-05-27T02:54:08.400

Given your intro paragraph, shouldn't "but exactly two" be "but exactly n"? – El'endia Starman – 2016-05-27T03:00:36.440

Different people have different computers and runtime will vary. Speed can even depend on the number of background processes, making it unreliable as a metric. – Zwei – 2016-05-27T03:00:48.500

You must provide timing details if you want this to be a [tag:fastest-code] competition. – James – 2016-05-27T03:02:27.553

1+7+2+9=19. 19*91 = 1729! – Arjun – 2016-05-27T05:51:15.750

The linked question asked for code to find the lowest (not nth-lowest) integer which is the sum of 2 positive cubes in n ways. – Rosie F – 2019-07-28T07:50:55.050

No answers