ok, i have recently learnt that 1729 is the only number that is the sum of two pairs of perfect cubes
viz: 1^3 + 12^3 = 10^3 + 9^3 = 1729..
But, i wasn't satisfied with this so I made a program to check.. Initially, i kept the ranges to be 1 to 100 , then changed it to 15 thinking whether 'int' would be enough for big numbers like 100^3... No matter what, it is supposed to show me 1729 (as 12<15)
But, it doesn't!!
Please tell me what mistake have I made... Because this program is not giving me any outputs..
//Why is this program not working???
public class Cubes
{
public static void main()
{
int[] a = new int[225];
int t;
for(int i=1; i<=15; i++)
{
for(int j=i; j<=15; j++)
{
t=i*i*i + j*j*j;
for(int l=0;l<225; l++)
{
if(a[l]==t)
{
System.out.println(a[l]);
}
}
for(int m=0; m<225; m++)
{
a[m] = t;
}
}
}
}
}
Please help me with this..