Taxicab Numbers

The famous mathematician Hardy relates the following episode with the (now also famous) Indian mathematician Ramanujan: I remember once going to see him when he was ill at Putney. I had ridden in taxi cab number 1729 and remarked that the number seemed to me rather a dull one, and that I hoped it was not an unfavorable omen. “No,” he replied, “it is a very interesting number; it is the smallest number expressible as the sum of two positive cubes in two different ways.” Your objective is to print cab numbers in a given range, [n1; n1 + rg], specified by its lower limit, n1, and the size of the interval, rg. A number is a cab number if it can be expressed as the sum of two positive cubes, in at least two different ways. Input Input contains several test cases. For each test case, you are given two numbers in two rows, the lower limit n1 and the range we are interested in, rg. The lower limit is between 1 and 1000000000 (1E+9). The range is between 1 and 100000. EOF indicates the end of the input. Output For each test case, you should output a list of cab numbers, in the specified range. The numbers should be separated by newlines. If there is no cab number in the range, you should output one single line with the word ‘None’. Sample Input 1000 20000 Sample Output 1729 4104 13832 20683