Given a positive integer $$$n$$$, compute the value of the following expression modulo $$$998244353$$$:
$$$$$$ \sum_{i=0}^n\sum_{j=0}^i\left(C_i^j \bmod 2\right) $$$$$$
Where:
$$$$$$ C_i^j = \begin{cases} \frac{i!}{j!(i - j)!}, & \text{if } 0 \leq j \leq i \\ 0, & \text{if } j \gt i \end{cases} $$$$$$
$$$$$$ m! = \begin{cases} 1, & \text{if } m = 0 \\ 1 \times 2 \times 3 \times \dots \times m, & \text{if } m \geq 1 \end{cases} $$$$$$
$$$$$$ 5 \bmod 2 = 1,\quad 8 \bmod 3 = 2,\quad 7 \bmod 7 = 0 $$$$$$
You need to output the value of the expression modulo $$$998244353$$$.
There are multiple test cases. The first line of the input contains a single integer $$$t$$$ $$$(1 \leq t \leq 3 \times 10^5)$$$, denoting the number of test cases. For each test case:
The first and only line contains one integer $$$n$$$ $$$(1 \leq n \leq 10^{18})$$$.
For each test case, output one line containing one integer, denoting the value of the expression modulo $$$998244353$$$.
3351145141919810
9 15 516911908
For the first sample test case, $$$n = 3$$$, so you need to compute the following expression:
$$$$$$ \sum_{i=0}^{3} \sum_{j=0}^{i} \left( C_i^j \bmod 2 \right) $$$$$$
Let's analyze each row of binomial coefficients modulo $$$2$$$:
So the total sum is $$$1 + 2 + 2 + 4 = 9$$$. And you need to output $$$9 \bmod 998244353 = 9$$$.
For the second sample test case, $$$n = 5$$$, so you need to compute the following expression:
$$$$$$ \sum_{i=0}^{5} \sum_{j=0}^{i} \left( C_i^j \bmod 2 \right) $$$$$$
Similarly:
Final result: $$$(1 + 2 + 2 + 4 + 2 + 4) \bmod 998244353 = 15$$$
For the third sample test case, I have a brilliant explanation, but the space here is too small to writ