Stores the perfect cubes of first N natural numbers
Dictionary < int , int > cubes = new Dictionary < int , int > ( ) ; for ( int i = 1 ; i * i * i <= N ; i ++ ) cubes . Add ( ( i * i * i ) , i ) ; var val = cubes . Keys . ToList ( ) ;