A coding challenge using exponents
One fine day, I was calculating the value of 5 and 8 cubed, which came out to be 125 and 512 respectively. As you can see, 1) The last digit shifted to the first or vice-versa 2) The last half of the number shifted to the first or vice-versa. I made a program on this, but this ended at a limit. My question is: Is there any pair like this which goes beyond the limit? Now, let me rephrase the thing you need to do. Write a program, iterate nos., calculate the cube and square of those nos., take the last (half/digit, digit preferred) and put it in the first (or take the first half/digit and put it in the last), and if the new no. is a perfect square or cube root, then print the pair. How many pairs do you get? (For languages supporting high value, is the limit being surpassed at some point of time?) Example output for loop variable i = 5 -- 5 = 125, 8 = 512