You are viewing a single comment's thread. Return to all comments →
g[20] is 267 or 266 ?
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.
267
n
sf(n)
20
g(20)
why we need to take 20?
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Project Euler #254: Sums of Digit Factorials
You are viewing a single comment's thread. Return to all comments →
g[20] is 267 or 266 ?
Since
267
is the lowest possiblen
insf(n)
to obtain20
,g(20)
is267
.why we need to take 20?