Search Problems   RSS Feed
projecteuler.net

Smallest Prime Factor

 Published on Sunday, 21st June 2015, 01:00 am and solved by 1058
Difficulty: Level 22 [57%]

Problem 521

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$.



Copied to Clipboard