Squaring and cubing numbers