#P5325. 【模板】Min_25 筛

【模板】Min_25 筛

Description

Define a multiplicative function f(x)f(x), and f(pk)=pk(pk1)f(p ^ k) = p ^ k(p ^ k - 1) (pp is a prime). Compute

i=1nf(i)\sum_{i = 1} ^ n f(i)

modulo 109+710 ^ 9 + 7.

Input Format

One line containing an integer nn.

Output Format

Output one integer, the answer.

10

263

1000000000

710164413

Hint

f(1)=1f(1)=1f(2)=2f(2)=2f(3)=6f(3)=6f(4)=12f(4)=12f(5)=20f(5)=20
f(6)=12f(6)=12f(7)=42f(7)=42f(8)=56f(8)=56f(9)=72f(9)=72f(10)=40f(10)=40

For 30%30\% of the testdata, it is guaranteed that 1n1061\le n\le 10^6.

For 100%100\% of the testdata, it is guaranteed that 1n10101\le n\le 10^{10}

Translated by ChatGPT 5