Hide

Problem C
Mynstursmisskilningur

Languages en is

Many students encounter proof by induction for the first time in the course Mathematical Structures for Computer Science. The teacher intended to set as homework the computation of the following sum

k=1n(kmodn)

.

When k=n it is zero, but otherwise k<n so kmodn is simply k. So the solution is

n(n1)2

.

There was however a mishap when typing the problem and the sum ended up being

k=1n(nmodk)

for quite a number of values of n. Every value of n from one up to N in fact! Since writing all of those down would take far too much space a different way of going about this has been decided on. Let sn be the sum for the value n. Then instead of writing down s1,,sn you only have to turn in the sum s1+5s2+25s3++5N1sN modulo 109+7.

Input

The first and only line of the input contains the integer 1N106.

Output

Print the sum described above.

Sample Input 1 Sample Output 1
5
2650
Sample Input 2 Sample Output 2
20
530437386
Hide

Please log in to submit a solution to this problem

Log in