Relationship between perfect squares and perfect cubes