DESCRIPTION
Given a number sequence [3,7,22,45,116,...][3,7,22,45,116,...]. Please tell me the kk-th number.
INPUT
A number T (T<100)T (T<100) indicates the number of the input cases. Then for each case there only is one integer k (1≤k≤10000)k (1≤k≤10000).
OUTPUT
For each case, ouput the kk-th number of the sequence in one line.
SAMPLE INPUT
214
SAMPLE OUTPUT
345 题意很简单,就是找规律,通过规律我们可以发现:
然后打表就可以过啦~
#include#include #include #include #include using namespace std;const int maxn=1000007;const int INF=0x3f3f3f3f;long long v[maxn], a[maxn], k;void Isprime(){ memset(v, 0, sizeof(v)); for(int i=2; i