Project Euler Lab - Problem 779

#779 - Prime Factor and Exponent

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

For a positive integer \(n \gt 1\), let \(p(n)\) be the smallest prime dividing \(n\), and let \(\alpha(n)\) be its \(p\)-adic order, i.e. the largest integer such that \(p(n)^{\alpha(n)}\) divides \(n\).

For a positive integer \(K\), define the function \(f_K(n)\) by: \[f_K(n)=\frac{\alpha(n)-1}{(p(n))^K}.\]

Also define \(\overline{f_K}\) by: \[\overline{f_K}=\lim_{N \to \infty} \frac{1}{N}\sum_{n=2}^{N} f_K(n).\]

It can be verified that \(\overline{f_1} \approx 0.282419756159\).

Find \(\displaystyle \sum_{K=1}^{\infty}\overline{f_K}\). Give your answer rounded to \(12\) digits after the decimal point.

This problem is taken from Project Euler, Problem 779.
Problem text © Project Euler, licensed under CC BY-NC-SA 4.0. Original: projecteuler.net/problem=779. Published Saturday, 1st January 2022, 01:00 pm. Solved by 620 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.