Last active
November 24, 2018 12:14
-
-
Save pablovv72/6fab7b88c8e6ffc2d36ff7570faa82a0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''Hallar un número acabado en 2 que cumpla la condición de que si se desplaza | |
el 2 a la posición inicial el número resultante es el doble del inicial.''' | |
n = 42 | |
exp = 2 | |
while 2 * 10 ** (exp - 2) + n // 10 != n * 2: | |
n = (n * 20 + 2) - (n * 20 + 2) // 10 ** exp * 10 ** exp | |
exp += 1 | |
print(n) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment