Project Euler #254: Sums of Digit Factorials

  • + 1 comment

    g[20] is 267 or 266 ?

    • + 1 comment
      sf(266)=s(2!+6!+6!)=s(2+720+720) =s(1442)=1+4+4+2=11
      sf(267)=s(2!+6!+7!)=s(2+720+5040)=s(5762)=5+7+6+2=20
      

      Since 267 is the lowest possible n in sf(n) to obtain 20, g(20) is 267.

      • + 0 comments

        why we need to take 20?