Function to print the required numbers less than n
function printValidNums ( n ) { let cbrt_n = Math . ceil ( Math . pow ( n , 1 / 3 ) ) ; for ( let i = 1 ; i <= cbrt_n ; i ++ ) { let cube = Math . pow ( i , 3 ) ;