Project Euler 62
Project Euler 62
题目
Cubic permutations
The cube, \(41063625\) (\(345^3\)), can be permuted to produce two other cubes: \(56623104\) (\(384^3\)) and \(66430125\) (\(405^3\)). In fact, \(41063625\) is the smallest cube which has exactly three permutations of its digits which are also cube.
Find the smallest cube for which exactly five permutations of its digits are cube.
解决方案
从小到大找出立方数。将使用数位的立方数汇总到一起。
如果其中一个集合先汇总了\(5\)个立方数,那么就输出最小的。
代码
1 | from itertools import count |