Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def is_permuted(x, n):
- r = x * n
- if sorted(str(r)) == sorted(str(x)):
- return True
- return False
- def main():
- i = 1
- while True:
- i += 1
- if all([is_permuted(i, z) for z in range(2, 7)]):
- print(i)
- break
- if __name__ == '__main__':
- main()
- 142857
- CPU times: user 1.74 s, sys: 0 ns, total: 1.74 s
- Wall time: 1.75 s
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement