2018-09-30 22:01:58 +00:00
---
id: 5900f3fa1000cf542c50ff0c
title: 'Problem 140: Modified Fibonacci golden nuggets'
2020-11-27 18:02:05 +00:00
challengeType: 5
2019-08-05 16:17:33 +00:00
forumTopicId: 301769
2021-01-13 02:31:00 +00:00
dashedName: problem-140-modified-fibonacci-golden-nuggets
2018-09-30 22:01:58 +00:00
---
2020-11-27 18:02:05 +00:00
# --description--
2021-07-16 19:38:37 +00:00
Consider the infinite polynomial series $A_G(x) = xG_1 + x^2G_2 + x^3G_3 + \cdots$, where $G_k$ is the $k$th term of the second order recurrence relation $G_k = G_{k − 1} + G_{k − 2}, G_1 = 1$ and $G_2 = 4$; that is, $1, 4, 5, 9, 14, 23, \ldots$.
2018-09-30 22:01:58 +00:00
2021-07-16 19:38:37 +00:00
For this problem we shall be concerned with values of $x$ for which $A_G(x)$ is a positive integer.
2018-09-30 22:01:58 +00:00
2021-07-16 19:38:37 +00:00
The corresponding values of $x$ for the first five natural numbers are shown below.
2018-09-30 22:01:58 +00:00
2021-07-16 19:38:37 +00:00
| $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$ |
2018-09-30 22:01:58 +00:00
2021-07-16 19:38:37 +00:00
We shall call $A_G(x)$ a golden nugget if $x$ is rational because they become increasingly rarer; for example, the 20th golden nugget is 211345365. Find the sum of the first thirty golden nuggets.
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
# --hints--
2018-09-30 22:01:58 +00:00
2021-07-16 19:38:37 +00:00
`modifiedGoldenNuggets()` should return `5673835352990`
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
```js
2021-07-16 19:38:37 +00:00
assert.strictEqual(modifiedGoldenNuggets(), 5673835352990);
2018-09-30 22:01:58 +00:00
```
2020-11-27 18:02:05 +00:00
# --seed--
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
## --seed-contents--
2018-09-30 22:01:58 +00:00
```js
2021-07-16 19:38:37 +00:00
function modifiedGoldenNuggets() {
2020-09-15 16:57:40 +00:00
2018-09-30 22:01:58 +00:00
return true;
}
2021-07-16 19:38:37 +00:00
modifiedGoldenNuggets();
2018-09-30 22:01:58 +00:00
```
2020-11-27 18:02:05 +00:00
# --solutions--
2018-09-30 22:01:58 +00:00
```js
// solution required
```