Function to return an ArrayList containing all the perfect cubes upto n
static List < Integer > getPerfectcubes ( int n ) { List < Integer > perfectcubes = new ArrayList < Integer > ( ) ; int current = 1 ; int i = 1 ;