Files
freeCodeCamp/curriculum/challenges/ukrainian/10-coding-interview-prep/project-euler/problem-140-modified-fibonacci-golden-nuggets.md

53 lines
1.9 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: 5900f3fa1000cf542c50ff0c
title: 'Завдання 140: Модифіковані золоті самородки Фібоначчі'
challengeType: 5
forumTopicId: 301769
dashedName: problem-140-modified-fibonacci-golden-nuggets
---
# --description--
Розглянемо нескінченний многочленний ряд $A_G(x) = xG_1 + x^2G_2 + x^3G_3 + \ cdots$, де $G_k$ - це $k$-й член рекурентного співвідношення другого порядку $G_k = G_ {k 1} + G_ {k 2}, G_1 = 1 $ і $G_2 = 4$; тобто $1, 4, 5, 9, 14, 23, \ldots$.
Для цієї задачі ми розглянемо значення $x$, для яких $A_G(x)$ є натуральним цілим числом.
Відповідні значення $x$ для перших п’яти натуральних чисел наведені нижче.
| $x$ | $A_G(x)$ |
| ----------------------------- | -------- |
| $\frac{\sqrt{5} 1}{4}$ | $1$ |
| $\frac{2}{5}$ | $2$ |
| $\frac{\sqrt{22} 2}{6}$ | $3$ |
| $\frac{\sqrt{137} 5}{14}$ | $4$ |
| $\frac{1}{2}$ | $5$ |
Ми будемо називати $A_G(x)$ золотим самородком при умові що $x$ - раціональне, оскільки вони стають все рідшими; наприклад, 20-й золотий самородок - 211345365. Знайдіть суму перших тридцяти золотих самородків.
# --hints--
`modifiedGoldenNuggets()` має повернути `5673835352990`
```js
assert.strictEqual(modifiedGoldenNuggets(), 5673835352990);
```
# --seed--
## --seed-contents--
```js
function modifiedGoldenNuggets() {
return true;
}
modifiedGoldenNuggets();
```
# --solutions--
```js
// solution required
```