Problem I. Problem I. Delightful Formulas
时间限制 10000 ms
内存限制 256 MB
Kazari is too bored this summer holiday, she decides to play with formulas.
First of all, she comes up with two positive integers $N, K$.
She loves power, therefore she builds a sequence $a$ where $a_i = i ^ K$ $(1 \le i \le N)$.
She loves summation, therefore she calculate the partial sum of $a$ as $s$, i.e. $s_i = \sum_{j \le i} {a_j}$ $(1 \le i \le N)$.
She also loves coprimes, therefore she calculate the sum of elements in $s$ whose index $i$ is coprime to $N$, i.e. $v = \sum_{1 \le i \le N, \gcd(i, N) = 1} {s_i}$
Your task is to work out $v$. Since the answer is too large, print it modulo $998244353$.
输入数据
输出数据
For each test case, print an integer representing the answer modulo $998244353$.
样例输入
复制
2
1
2
2 1
3 1
233
1
23333 1
样例输出
$ Mathjax font initiator $