Project Euler Lab - Problem 368

#368 - A Kempner-like Series

● ResearchOfficial difficulty: 77%ApproximationTier C - reduced scale in browser; full scale in notebookNot viewed
↖ Euler Lab

The harmonic series \(1 + \frac 1 2 + \frac 1 3 + \frac 1 4 + \cdots\) is well known to be divergent.

If we however omit from this series every term where the denominator has a \(9\) in it, the series remarkably enough converges to approximately \(22.9206766193\).
This modified harmonic series is called the Kempner series.

Let us now consider another modified harmonic series by omitting from the harmonic series every term where the denominator has \(3\) or more equal consecutive digits. One can verify that out of the first \(1200\) terms of the harmonic series, only \(20\) terms will be omitted.
These \(20\) omitted terms are:

\[\frac 1 {111}, \frac 1 {222}, \frac 1 {333}, \frac 1 {444}, \frac 1 {555}, \frac 1 {666}, \frac 1 {777}, \frac 1 {888}, \frac 1 {999}, \frac 1 {1000}, \frac 1 {1110},\] \[\frac 1 {1111}, \frac 1 {1112}, \frac 1 {1113}, \frac 1 {1114}, \frac 1 {1115}, \frac 1 {1116}, \frac 1 {1117}, \frac 1 {1118}, \frac 1 {1119}.\]

This series converges as well.

Find the value the series converges to.
Give your answer rounded to \(10\) digits behind the decimal point.

This problem is taken from Project Euler, Problem 368.
Problem text © Project Euler, licensed under CC BY-NC-SA 4.0. Original: projecteuler.net/problem=368. Published Sunday, 22nd January 2012, 01:00 am. Solved by 633 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.