Euler 63

'''The 5-digit number, 16807=7^5, is also a fifth power. Similarly, the 9-digit number, 134217728=8^9, is a ninth power.

How many n-digit positive integers exist which are also an nth power?'''

cont = 0
# Un bucle para el exponente: de 1 a 21.
for n in range(1,22):
  #Para cada exponente un bucle entre los valores permitidos.
  for j in range(int(10**(1-1/n)+1),10):
    
      
    print (j,n,j**n)
      
    cont +=1
    
print ("El número de cifras es: ",cont)