APS - Amazing Prime Sequence
题意翻译
### 题目描述
Bablu 非常喜欢序列,他按照以下方式设计了自己的序列:$a_0=a_1=0$,对于 $n(n>1)$,$a_n=a_{n-1}+f_n$,其中 $f_n$ 是 $n$ 的最小素因子。 他也非常喜欢编程,因此制作了一个小程序来找到 $a_n$,但由于他不擅长编程。所以,他请你帮忙找到 $a_n$。
### 输入格式
**本题有多组数据**。
第一行输入包含 $T(T\le 100)$,即测试用例的数量。
接下来的 $T$ 行包含单个数字 $n(1<n<10^7)$。
### 输出格式
共 $T$ 行,每行包含对应的 $a_n$。
题目描述
Bablu is very fond of Series and Sequences...
After studying Fibonacci Series in Class IX, he was impressed and he designed his own sequence as follows...
a\[0\] = a\[1\] = 0
For n > 1, a\[n\] = a\[n - 1\] + f(n), where f(n) is smallest prime factor of n.
He is also very fond of programming and thus made a small program to find a\[n\], but since he is in Class IX, he is not very good at programming. So, he asks you for help. Your task is to find a\[n\] for the above sequence....
输入输出格式
输入格式
Your code will be checked for multiple Test Cases.
First Line of Input contains T (<= 100), the number of Test Cases.
Next T lines contain a single number N. (1 < N < 10^7).
输出格式
Single line containing a\[n\] i.e. nth number of the sequence for each test case.
输入输出样例
输入样例 #1
3
2
3
4
输出样例 #1
2
5
7