F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

function

Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 2640    Accepted Submission(s): 941


Problem Description
There is a function $f(x)$,which is defined on the natural numbers set $N$,satisfies the following eqaution

$N^2-3N+2=\sum_{d|N} f(d)$

calulate $\sum_{i=1}^{N} f(i)$ $~mod~10^9+7$.
 

Input
the first line contains a positive integer T,means the number of the test cases.

next T lines there is a number N


$T \leq 500, N \leq 10^9$

only $5~$test cases has $N > 10^6$.
 

Output
$T$lines,each line contains a number,means the answer to the $i$-th test case.
 

Sample Input
1 3
 

Sample Output
2 $1^2-3*1+2=f(1)=0$ $2^2-3*2+2=f(2)+f(1)=0->f(2)=0$ $3^2-3*3+2=f(3)+f(1)=2->f(3)=2$ $f(1)+f(2)+f(3)=2$
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-21 15:19:13, Gzip enabled