Files
freeCodeCamp/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-140-modified-fibonacci-golden-nuggets.english.md
Valeriy 79d9012432 fix(curriculum): quotes in tests (#18828)
* fix(curriculum): tests quotes

* fix(curriculum): fill seed-teardown

* fix(curriculum): fix tests and remove unneeded seed-teardown
2018-10-20 23:32:47 +05:30

68 lines
1.3 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: 5900f3fa1000cf542c50ff0c
challengeType: 5
title: 'Problem 140: Modified Fibonacci golden nuggets'
---
## Description
<section id='description'>
Consider the infinite polynomial series AG(x) = xG1 + x2G2 + x3G3 + ..., where Gk is the kth term of the second order recurrence relation Gk = Gk1 + Gk2, G1 = 1 and G2 = 4; that is, 1, 4, 5, 9, 14, 23, ... .
For this problem we shall be concerned with values of x for which AG(x) is a positive integer.
The corresponding values of x for the first five natural numbers are shown below.
xAG(x)
(√51)/41
2/52
(√222)/63
(√1375)/144
1/25
We shall call AG(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.
</section>
## Instructions
<section id='instructions'>
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler140()</code> should return 5673835352990.
testString: assert.strictEqual(euler140(), 5673835352990, '<code>euler140()</code> should return 5673835352990.');
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler140() {
// Good luck!
return true;
}
euler140();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>