要求一串數列(n個,且遞增
)
且在a2以後的數字*3
不得被前兩數的和整除
ex:
n=4
1 . 2 . 5 . 6 ==> (O) 3*5 % (1+2) != 0;
且 6*3 % (2+5) != 0;
n=4
1 . 2 . 3 . 4 ==> (X) 3*3 % (1+2) == 0
1 . 3 . 5 . 7 . 9........n
#include <iostream>
using namespace std;
int main()
{
int t = 0, n = 0;
int k = 1;
cin >> t;
while (t--)
{
cin >> n;
for (int i = 0; i < n; i++)
{
cout << k << " ";
k = k + 2;
}
}
cout << endl;
return 0;
}