0%

Problem 254


Problem 254


Sums of Digit Factorials

Define f(n) as the sum of the factorials of the digits of n. For example, f(342) = 3! + 4! + 2! = 32.

Define sf(n) as the sum of the digits of f(n). So sf(342) = 3 + 2 = 5.

Define g(i) to be the smallest positive integer n such that sf(n) = i. Though sf(342) is 5, sf(25) is also 5, and it can be verified that g(5) is 25.

Define sg(i) as the sum of the digits of g(i). So sg(5) = 2 + 5 = 7.

Further, it can be verified that g(20) is 267 and ∑ sg(i) for 1 ≤ i ≤ 20 is 156.

What is ∑ sg(i) for 1 ≤ i ≤ 150?


各位数字阶乘的和

记f(n)是n的各位数字的阶乘的和。例如,f(342) = 3! + 4! + 2! = 32。

记sf(n)是f(n)的各位数字的和。因此sf(342) = 3 + 2 = 5。

记g(i)是使得sf(n) = i的最小n值。尽管sf(342)为5,然而sf(25)也为5,因此可以验证g(5)是25。

记sg(i)是g(i)的各位数字之和。因此sg(5) = 2 + 5 = 7。

进一步地,可以验证g(20)为267,以及对于1 ≤ i ≤ 20,∑ sg(i)为156。

对于1 ≤ i ≤ 150,∑ sg(i)是多少?