QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 1024 MB Total points: 100

#21405. Min_25 筛

統計

Source: Libre OJ 6053

某一天,你发现了一个神奇的函数$f(x)$,它满足很多神奇的性质:

  1. $f(1)=1$。
  2. $f(p^c)=p \oplus c$($p$ 为质数,$\oplus$ 表示异或)。
  3. $f(ab)=f(a)f(b)$($a$ 与 $b$ 互质)。

你看到这个函数之后十分高兴,于是就想要求出 $\sum\limits_{i=1}^n f(i)$。

由于这个数比较大,你只需要输出 $\sum\limits_{i=1}^n f(i) \bmod (10^9+7)$。

Input

一行一个整数 $n$。

Output

一行一个整数 $\sum\limits_{i=1}^n f(i) \bmod 1000000007$。

Examples

Input 1

6

Output 1

16

Input 2

233333

Output 2

179004642

Input 3

9876543210

Output 3

895670833

Scoring

对于$30\%$的数据,$n \leq 100$。

对于$60\%$的数据,$n \leq 10^6$。

对于$100\%$的数据,$1 \leq n \leq 10^{10}$。

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.