# tju3772. Rupxup's Math Problem

### Description

Rupxup has learned a new function called function "F(n)", where F(n) equals to the number of factors of n (including 1 and n). For example, F(1) = 1, F(4) = 3, ... Now if you ask Rupxup to calculate F(n), he may soon tell you the answer. If you are evil enough and ask him about the sum of the first k F(i): (F(1) + F(2) + .. + F(k) = G(k)), I believe out superbrother Rupxup will soon tell you the answer too!

### Input

In the first line there is an integer T, indicates the number of test cases. (T ≤ 100) In each case, the first line contains only one integer k. (1 ≤ k ≤ 109).

### Output

Just output G(k).

3
1
2
3

### Sample Output

1
3
5

，，这题太劲了，，一开始的想法就是分段打表，结果还是有点难写，，然后一不小心瞄到标程上数形结合这4个大字，，惊呆了。。。

x=1的时候有n个，x=2的时候有n/2-1个。。。

LL f(LL n)
{
if (n<=5) return a[n];
LL sum = 0;
int i;
for (i = 1; i*i <= n; ++i)
{
sum += m/i - (i - 1);
}
return sum*2-i+1;
}

#### TOJ3772 Rupxup's Math Problem

2017-12-11 16:21:55

#### 杭电OJ——1098 Ignatius's puzzle

2012-10-17 22:23:03

#### hdu 5803 Zhu’s Math Problem （2016多校第六场1011）数位dp

2016-08-05 22:10:16

#### scalarprod.pdf

2013年03月25日 251KB 下载

#### NYOJ 2333 A simple math problem(思路题）

2017-06-30 17:58:30

#### Hihocoder 1259 :A Math Problem(2015 北京区域赛 K,二进制的数位dp)

2016-08-12 19:59:44

#### 2015ACM-ICPC 北京赛区 Problem K. A Math Problem

2016-07-13 13:24:42

#### hihoCoder 1259 A Math Problem（数位dp）

2015-11-16 15:48:18

#### HDU6182-A Math Problem

2017-09-03 17:46:45

#### hdu5942 Just a Math Problem

2016-10-31 18:51:52