Project Euler Lab - Problem 437

#437 - Fibonacci Primitive Roots

● AppliedOfficial difficulty: 23%DivisibilityTier B - browser, with the efficient algorithmNot viewed
↖ Euler Lab

When we calculate \(8^n\) modulo \(11\) for \(n=0\) to \(9\) we get: \(1, 8, 9, 6, 4, 10, 3, 2, 5, 7\).
As we see all possible values from \(1\) to \(10\) occur. So \(8\) is a primitive root of \(11\).
But there is more:
If we take a closer look we see:
\(1+8=9\)
\(8+9=17 \equiv 6 \bmod 11\)
\(9+6=15 \equiv 4 \bmod 11\)
\(6+4=10\)
\(4+10=14 \equiv 3 \bmod 11\)
\(10+3=13 \equiv 2 \bmod 11\)
\(3+2=5\)
\(2+5=7\)
\(5+7=12 \equiv 1 \bmod 11\).

So the powers of \(8 \bmod 11\) are cyclic with period \(10\), and \(8^n + 8^{n+1} \equiv 8^{n+2} \pmod{11}\).
\(8\) is called a Fibonacci primitive root of \(11\).
Not every prime has a Fibonacci primitive root.
There are \(323\) primes less than \(10000\) with one or more Fibonacci primitive roots and the sum of these primes is \(1480491\).
Find the sum of the primes less than \(100\,000\,000\) with at least one Fibonacci primitive root.
This problem is taken from Project Euler, Problem 437.
Problem text © Project Euler, licensed under CC BY-NC-SA 4.0. Original: projecteuler.net/problem=437. Published Saturday, 21st September 2013, 10:00 pm. Solved by 1,002 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 B - browser, with the efficient algorithm
Runs in the browser only with the intended efficient algorithm; a naive loop will hit the timeout.

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.