---
id: 5900f46b1000cf542c50ff7d
challengeType: 5
title: 'Problem 254: Sums of Digit Factorials'
videoUrl: ''
localeTitle: 问题254：数字因子的总和
---

## Description
<section id="description">将f（n）定义为n的数字的阶乘的总和。例如，f（342）= 3！ + 4！ + 2！ = 32。 <p>将sf（n）定义为f（n）的数字之和。所以sf（342）= 3 + 2 = 5。 </p><p>将g（i）定义为最小的正整数n，使得sf（n）= i。虽然sf（342）是5，但sf（25）也是5，并且可以证实g（5）是25。 </p><p>将sg（i）定义为g（i）的数字之和。所以sg（5）= 2 + 5 = 7。 </p><p>此外，可以证实g（20）是267并且1≤i≤20的Σsg（i）是156。 </p><p>什么是Σsg（i）1≤i≤150？ </p></section>

## Instructions
<section id="instructions">
</section>

## Tests
<section id='tests'>

```yml
tests:
  - text: <code>euler254()</code>应该返回8184523820510。
    testString: 'assert.strictEqual(euler254(), 8184523820510, "<code>euler254()</code> should return 8184523820510.");'

```

</section>

## Challenge Seed
<section id='challengeSeed'>

<div id='js-seed'>

```js
function euler254() {
  // Good luck!
  return true;
}

euler254();

```

</div>



</section>

## Solution
<section id='solution'>

```js
// solution required
```
</section>
