Project Euler Lab - Problem 137

#137 - Fibonacci Golden Nuggets

● AdvancedOfficial difficulty: 33%RecurrencesTier C - reduced scale in browser; full scale in notebookNot viewed
↖ Euler Lab

Consider the infinite polynomial series \(A_F(x) = x F_1 + x^2 F_2 + x^3 F_3 + \dots\), where \(F_k\) is the \(k\)th term in the Fibonacci sequence: \(1, 1, 2, 3, 5, 8, \dots\); that is, \(F_k = F_{k-1} + F_{k-2}\), \(F_1 = 1\) and \(F_2 = 1\).

For this problem we shall be interested in values of \(x\) for which \(A_F(x)\) is a positive integer.

Surprisingly\(\begin{align*} A_F(\tfrac{1}{2}) &= (\tfrac{1}{2})\times 1 + (\tfrac{1}{2})^2\times 1 + (\tfrac{1}{2})^3\times 2 + (\tfrac{1}{2})^4\times 3 + (\tfrac{1}{2})^5\times 5 + \cdots \\ &= \tfrac{1}{2} + \tfrac{1}{4} + \tfrac{2}{8} + \tfrac{3}{16} + \tfrac{5}{32} + \cdots \\ &= 2 \end{align*}\)

The corresponding values of \(x\) for the first five natural numbers are shown below.

\(x\)\(A_F(x)\)
\(\sqrt{2}-1\)\(1\)
\(\tfrac{1}{2}\)\(2\)
\(\frac{\sqrt{13}-2}{3}\)\(3\)
\(\frac{\sqrt{89}-5}{8}\)\(4\)
\(\frac{\sqrt{34}-3}{5}\)\(5\)

We shall call \(A_F(x)\) a golden nugget if \(x\) is rational, because they become increasingly rarer; for example, the \(10\)th golden nugget is \(74049690\).

Find the \(15\)th golden nugget.

This problem is taken from Project Euler, Problem 137.
Problem text © Project Euler, licensed under CC BY-NC-SA 4.0. Original: projecteuler.net/problem=137. Published Friday, 12th January 2007, 06:00 pm. Solved by 6,548 members at time of mirroring.

Why this is useful

Numerical Computing. Matrix methods and linear-recurrence acceleration are the machinery behind covariance work, PCA, and lattice/transition models (Phases 4, 5, 8).

We classify relevance honestly - not every Euler problem is a trading application.

Learning mode

Pick how much scaffolding you want. Your choice is remembered per problem.

Scratchpad

Mathematical notes, formulas, pseudocode, hypotheses, complexity notes. Saved automatically with your progress.

Python workbench

Tier C - reduced scale in browser; full scale in notebook
Browser runs a reduced, clearly-labelled educational scale; the original scale is provided in a local notebook.

Real Python (Pyodide) in a sandboxed Web Worker - no network, no filesystem, no DOM access. Ctrl/Cmd+Enter runs. Escape leaves the editor. Stop terminates the worker.

Python runtime not loaded (it boots on first run - a one-time local load).

Check your answer

Answers are checked against a salted hash held in a separate file - not printed in this page. This prevents accidental spoilers; it is not cryptographic protection (see the build notes).

Progressive hints

Confidence

Low confidence schedules this problem for spaced review, even if you solved it.

Reference solution

Spoiler
The complete original explanation (interpretation, naive approach, insight, proof, complexity, Python implementation, tests, common mistakes, alternatives) is hidden and lazy-loaded. Reveal it only after a meaningful attempt - the struggle is where the learning happens.