From b172ec38418044cefaaa6aafcf56eee172308de2 Mon Sep 17 00:00:00 2001 From: Daniel Ingram Date: Tue, 3 Apr 2018 00:04:38 -0400 Subject: [PATCH] Solution to Problem 52 --- Project Euler/Problem 52/sol1.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Project Euler/Problem 52/sol1.py diff --git a/Project Euler/Problem 52/sol1.py b/Project Euler/Problem 52/sol1.py new file mode 100644 index 000000000..376b4cfa1 --- /dev/null +++ b/Project Euler/Problem 52/sol1.py @@ -0,0 +1,23 @@ +from __future__ import print_function +''' +Permuted multiples +Problem 52 + +It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order. + +Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x, contain the same digits. +''' +i = 1 + +while True: + if sorted(list(str(i))) == \ + sorted(list(str(2*i))) == \ + sorted(list(str(3*i))) == \ + sorted(list(str(4*i))) == \ + sorted(list(str(5*i))) == \ + sorted(list(str(6*i))): + break + + i += 1 + +print(i) \ No newline at end of file