Iterate in the range [ 0 , 10 ^ 5 ]
for ( let i = 0 ; i < 100000 ; i ++ ) { if ( parseInt ( Math . pow ( i + 1 , 3 ) , 10 ) - parseInt ( Math . pow ( i , 3 ) , 10 ) == N ) { document . write ( i + " " + ( i + 1 ) ) ; return ; } } }