1 parent 6a8f1cf commit b172ec3Copy full SHA for b172ec3
1 file changed
Project Euler/Problem 52/sol1.py
@@ -0,0 +1,23 @@
1
+from __future__ import print_function
2
+'''
3
+Permuted multiples
4
+Problem 52
5
+
6
+It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order.
7
8
+Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x, contain the same digits.
9
10
+i = 1
11
12
+while True:
13
+ if sorted(list(str(i))) == \
14
+ sorted(list(str(2*i))) == \
15
+ sorted(list(str(3*i))) == \
16
+ sorted(list(str(4*i))) == \
17
+ sorted(list(str(5*i))) == \
18
+ sorted(list(str(6*i))):
19
+ break
20
21
+ i += 1
22
23
+print(i)
0 commit comments