Project Euler #254: Sums of Digit Factorials

  • + 1 comment

    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!...

    • + 0 comments

      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.