Iterate in the range [ 0 , 10 ^ 5 ]
for ( int i = 0 ; i < 100000 ; i ++ ) { if ( Math . pow ( i + 1 , 3 ) - Math . pow ( i , 3 ) == N ) { int j = i + 1 ; System . out . println ( i + " ▁ " + j ) ; return ; } } }