We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Since all digits of n are evaluated independently, n is not a regular integer. You can see n as a combination with repetition of digits 0-9 where the order does not matter.
Also the goal is to have the smallest value. #0 > 1# & #! + 0! == 1! + #!, therefore always use 1 instead of 0. 11 > 2 & 1! + !1 == 2!, therefore always use 2 instead of 1 & 1. 222 > 3 & 2! + 2! + 2! == 3!...
Project Euler #254: Sums of Digit Factorials
You are viewing a single comment's thread. Return to all comments →
Since all digits of
n
are evaluated independently,n
is not a regular integer. You can seen
as a combination with repetition of digits0-9
where the order does not matter.Also the goal is to have the smallest value.
#0 > 1# & #! + 0! == 1! + #!
, therefore always use 1 instead of 0.11 > 2 & 1! + !1 == 2!
, therefore always use 2 instead of 1 & 1.222 > 3 & 2! + 2! + 2! == 3!
...Ahh I see! Thanks! That make sense :) So you can extend this even further to N amount of digits. 3333 is the same as 4, so on and so forth.