cswork / OA打开练习工作台

CitadelOA #10

Checksum Aggregation

估计困难可在线判题

考点(AI 标注)位运算

Packets are numbered 1..n, and C(i,j)=i mod j+j mod i. Find the sum of C over all ordered pairs modulo 1000000007. The diagonal terms are 0, so it makes no difference whether the pairs must consist of distinct packets.

输入格式

One line containing n; complete OCR bound 1≤n≤1000000.

输出格式

Output a single integer, the answer.

样例 1

输入:

2

输出:

2

样例 2

输入:

3

输出:

10

样例 3

输入:

4

输出:

24

样例说明

The outputs of the three public examples are, in order: 2; 10; 24. These answers were verified by independent enumeration or direct simulation.