<<   >>

17. 1729

You may have heard of the following story about Hardy and Ramanujan. One day Hardy took a taxi to visit Ramanujan. On arriving Hardy told Ramanujan that the taxi had the thoroughly unremarkable 4-digit number n on its license plate. Ramanujan immediately remarked that n is the first number that … . I forget what n or the property was, something like, n is the first number that can be written as the sum of two perfect cubes in two different ways, something typically Ramanujanian.

Yes, that was it:

   c← i×i×i← 1+⍳200
   t← (∘.<⍨⍳200) × ∘.+⍨c
   d← {⊂⍵}⌸⍨ ,t
   (2=≢¨d)/d
┌─────────┬───────────────┬───────────────┬─────────┬─
│1729 1729│1092728 1092728│3375001 3375001│4104 4104│...
└─────────┴───────────────┴───────────────┴─────────┴─
   ⌊/ ⊃¨ (2=≢¨d)/d
1729
   1 + ⍸ 1729=t
┌────┬────┐
│1 12│9 10│
└────┴────┘
   +/ 1 12 * 3
1729
   +/ 9 10 * 3
1729

Now that I have worked out the number I can find the story on the net [62]. On hearing the story, J.E. Littlewood remarked that “every positive integer was one of [Ramanujan’s] personal friends”.



Appeared in J in [63] and in APL in [64].