Files
freeCodeCamp/curriculum/challenges/ukrainian/10-coding-interview-prep/project-euler/problem-341-golombs-self-describing-sequence.md
2022-04-11 19:34:39 +05:30

48 lines
1.3 KiB
Markdown
Raw Permalink 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: 5900f4c11000cf542c50ffd3
title: 'Задача 341: Послідовність Голомба, яка описує саму себе'
challengeType: 5
forumTopicId: 302000
dashedName: problem-341-golombs-self-describing-sequence
---
# --description--
Послідовність Голомба ($G(n)$) є єдиною незменшувальною послідовність натуральних чисел, така що $n$ з'являється рівно $G(n)$ разів у послідовності. Значення $G(n)$ для перших кількох $n$ є
$$\початок{array}{c} n & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & \ldots \\\\
G(n) & 1 & 2 & 2 & 3 & 3 & 4 & 4 & 4 & 5 & 5 & 5 & 6 & 6 & 6 & 6 & \ldots \end{array}$$
Вам дано що $G({10}^3) = 86$, $G({10}^6) = 6137$.
Вам дано що $\sum G(n^3) = 153\\,506\\,976$ for $1 ≤ n < {10}^3$.
Знайти $\sum G(n^3)$ для $1 ≤ n < {10}^6$.
# --hints--
`golombsSequence()` має повернути `56098610614277016`.
```js
assert.strictEqual(golombsSequence(), 56098610614277016);
```
# --seed--
## --seed-contents--
```js
function golombsSequence() {
return true;
}
golombsSequence();
```
# --solutions--
```js
// solution required
```