P521
projecteuler.net

Smallest Prime Factor

ℹ️Published on Sunday, 21st June 2015, 01:00 am; Solved by 853;
Difficulty rating: 50%

Let $\operatorname{smpf}(n)$ be the smallest prime factor of $n$.
$\operatorname{smpf}(91)=7$ because $91=7\times 13$ and $\operatorname{smpf}(45)=3$ because $45=3\times 3\times 5$.
Let $S(n)$ be the sum of $\operatorname{smpf}(i)$ for $2 \le i \le n$.
E.g. $S(100)=1257$.

Find $S(10^{12}) \bmod 10^9$.



Soluzione

Last modified: May 01, 2025. Website built with Franklin.jl and the lovely Julia programming language.