欧拉计划 发表于 2017-1-11 18:22:49

题目254:数位阶乘之和

本帖最后由 永恒的蓝色梦想 于 2020-8-31 07:50 编辑

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)。
页: [1]
查看完整版本: 题目254:数位阶乘之和