p052.py 440 Bytes
Newer Older
1 2
# 
# Solution to Project Euler problem 52
3
# Copyright (c) Project Nayuki. All rights reserved.
4
# 
5
# https://www.nayuki.io/page/project-euler-solutions
6 7 8 9 10 11 12
# https://github.com/nayuki/Project-Euler-solutions
# 

import itertools


def compute():
13 14 15
	cond = lambda i: all(sorted(str(i)) == sorted(str(j * i)) for j in range(2, 7))
	ans = next(i for i in itertools.count(1) if cond(i))
	return str(ans)
16 17 18 19


if __name__ == "__main__":
	print(compute())