1
0
www.mikescher.com/www/statics/euler/Euler_Problem-052_explanation.md

7 lines
547 B
Markdown
Raw Normal View History

2017-11-08 17:39:50 +01:00
To be a permutation all six numbers have to have the same digit count. So `digitcount(x) == digitcount(x*6)`.
This for each number of digits only given for the numbers from `10^n` to `10/6 * 10^n`.
We perform the permutation check with an modified version of the algorithm used in problem-49 *(product of all digits plus two)*.
But we generalise the code to work with every number of digits.
And because we greatly limited the amount of numbers to search and the permutation test is pretty fast this is all we need to do (except run the code).