Completed printPowersOfN