# Next number after 1729??

I have known this from beginning that

1729 is the smallest number expressible as the sum of two cubes in two different ways:

$$12^3 + 1^3$$

and

$$10^3+9^3$$

I am a Software Developer and if someone can tell me the logic to write a program for printing such types of number will be greatly helpful.

-
I don´t understand what you mean by "next number", other number expressible as the sum of two cubes, or the smallest number greater than 1729 expressible as the sum of two cubes? –  dwarandae Jan 30 '13 at 15:55
oeis.org/A001235 –  MJD Jan 30 '13 at 17:21
I am also looking for an efficient program in Pari gp for finding numbers that are sums of three cubes in at least two ways. I do belive that programming efficiency, here, consists in writing first into RAM memory all the numbers which are sum of k cubes (k=2 or (k=3 in my case)) and then just find the numbers that coincide. But i do not know how to write such a program as i am self taught. –  user55514 Jan 31 '13 at 14:20
Note that $1729$ is the smallest number expressible as a sum of two positive integer cubes in two different ways. While allowing a cube of zero doesn't introduce new solutions (case of Fermat's Last Thm.), allowing negative cubes does. For example $9^3 + (-1)^3 = 12^3 + (-10)^3$ is smaller than $1729$. –  hardmath Jan 31 '13 at 14:36
+1 @hardmath . Noone knows this. –  vikiiii Jan 31 '13 at 14:47
show 1 more comment

There are a couple of code snippets there for you to work with.

The sequence continues as follows:

$1729 = (1^3 + 12^3)$ or $(9^3 + 10^3)$

$4104 = (2^3 + 16^3)$ or $(9^3 + 15^3)$

$13832 = (2^3 + 24^3)$ or $(18^3 + 20^3)$

$20683 = (10^3 + 27^3)$ or $(19^3 + 24^3)$

$32832 = (4^3 + 32^3)$ or $(18^3 + 30^3)$

$39312 = (2^3 + 34^3)$ or $(15^3 + 33^3)$

$40033 = (9^3 + 34^3)$ or $(16^3 + 33^3)$

$46683 = (3^3 + 36^3)$ or $(27^3 + 30^3)$

$64232 = (17^3 + 39^3)$ or $(26^3 + 36^3)$

$65728 = (12^3 + 40^3)$ or $(31^3 + 33^3)$

After that you have: $110656, 110808, 134379, 149389, 165464, 171288, 195841, 216027, 216125, 262656$, etc.

You might also be interested in exploring:

$\bullet$ Diophantine Equation--3rd Powers

$\bullet$ Cubic Numbers

$\bullet$ Taxi Numbers in JavaScript

Regards

-
Almost at a "nice answer" badge...+1 nudge closer ;-) –  amWhy May 5 '13 at 0:20

The bruteforce approach is simple.

Loop over integers $k$.

For $1\leq i<\frac k2$ check whether or not $i$ has a cubic root, and whether or not $k-i$ has a cubic root. If so, collect the pair.

When the collection of pairs has more than one pair, collect $k$.

Stop at some arbitrarily large integer, and print the collected $k$'s and the pairs collected for each.

There is probably a much better approach using heuristics though.

-
Slightly less brute force: For $i=1,2,\ldots$ check whether or not $k-i^3$ has a cube root. Stop when $i^3>k/2$. –  Harald Hanche-Olsen Jan 30 '13 at 15:56
Of course, in Haskell, you wouldn't need to stop anywhere. You can just calculate them all and print a finite subset. –  akkkk Jan 30 '13 at 16:03
$$1729=11^3+1^3=10^3+9^3$$
Now multiply this equation by $k^3$, this gives you $$1729k^3=(11k)^3+(k)^3=(10k)^3+(9k)^3.$$ Now put $k=1,2,3,4,....$ to obtain some terms of this sequence.