Print integer powers and printing code duplication