Project Euler #254: Sums of Digit Factorials

  • + 1 comment

    Hey !!

    Can you please tell me something briefly about : 1) Input Values 2) Output Values

    I am not able get it in problem statement .

    • + 4 comments
      g(1)= 1, sf( 1) = s(   1!) = s(  1) =     1 = 1
      g(2)= 2, sf( 2) = s(   2!) = s(  2) =     2 = 2
      g(3)= 5, sf( 5) = s(   5!) = s(120) = 1+2+0 = 3
      g(4)=15, sf(15) = s(1!+5!) = s(121) = 1+2+1 = 4
      There is no number smaller than 15 which yeild 4.
      

      Let's take 1 query at a time and ignore the modulo.
      n=4 would mean :

      sg(1)+sg(2)+sg(3)+sg(4)
       s(1)+ s(2)+ s(5)+s(15)
         1 +   2 +   5 + 1+5
      
      • + 0 comments

        Okay got it !!!!! Just please tell me more about input values

      • + 0 comments

        how to find g(4)=15

      • + 0 comments

        What if the value exceeds more than 4 then should i have to find the g(7) and then put it to add the no.

      • + 0 comments

        g(3)= 5, sf( 5) = s( 5!) = s(120) = 1+2+0 = 3 how 121 will come? someone please elaborate this.