Files
freeCodeCamp/curriculum/challenges/russian/08-coding-interview-prep/project-euler/problem-254-sums-of-digit-factorials.russian.md

56 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
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, а Σ sg (i) для 1 ≤ i ≤ 20 составляет 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>