Project Euler Lab - Problem 751

#751 - Concatenation Coincidence

● AppliedOfficial difficulty: 15%DivisibilityTier C - reduced scale in browser; full scale in notebookNot viewed
↖ Euler Lab

A non-decreasing sequence of integers \(a_n\) can be generated from any positive real value \(\theta\) by the following procedure: \[\begin{align} \begin{split} b_1 &= \theta \\ b_n &= \left\lfloor b_{n-1} \right\rfloor \left(b_{n-1} - \left\lfloor b_{n-1} \right\rfloor + 1\right)~~~\forall ~ n \geq 2 \\ a_n &= \left\lfloor b_{n} \right\rfloor \end{split} \end{align}\] Where \(\left\lfloor \cdot \right\rfloor\) is the floor function.

For example, \(\theta=2.956938891377988...\) generates the Fibonacci sequence: \(2, 3, 5, 8, 13, 21, 34, 55, 89, ...\)

The concatenation of a sequence of positive integers \(a_n\) is a real value denoted \(\tau\) constructed by concatenating the elements of the sequence after the decimal point, starting at \(a_1\): \(a_1.a_2a_3a_4...\)

For example, the Fibonacci sequence constructed from \(\theta=2.956938891377988...\) yields the concatenation \(\tau=2.3581321345589...\) Clearly, \(\tau \neq \theta\) for this value of \(\theta\).

Find the only value of \(\theta\) for which the generated sequence starts at \(a_1=2\) and the concatenation of the generated sequence equals the original value: \(\tau = \theta\). Give your answer rounded to \(24\) places after the decimal point.

This problem is taken from Project Euler, Problem 751.
Problem text © Project Euler, licensed under CC BY-NC-SA 4.0. Original: projecteuler.net/problem=751. Published Saturday, 13th March 2021, 10:00 pm. Solved by 2,831 members at time of mirroring.

Why this is useful

Numerical Computing. Precision, conditioning, and numerical iteration transfer directly to pricing engines and model calibration (Phases 5, 13, 15).

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.