Permuted Multiples¶
There's a chance you think of 1/7 when you read this problem and immediately find the answer. But if not, it doesn't take long for the computer to tell you.
In [1]:
from itertools import count
for n in count(1):
digits = set(str(n))
for x in (2, 3, 4, 5, 6):
if set(str(n*x)) != digits:
break
else:
break
n
Out[1]:
142857
Copyright (C) 2025 filifa¶
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license and the BSD Zero Clause license.