#P9308. Triple Sum LCM-GCD
Triple Sum LCM-GCD
Triple Sum LCM-GCD
Define the function \(f(n)\) as follows:
\[ f(n) = \sum_{i=1}^{n} \sum_{j=1}^{n} \sum_{k=1}^{n} \left[ i+j+k=n \right] \operatorname{lcm}(i,\,\gcd(j,k)) \]
Here, \([P]\) is the indicator function, which is 1 if the condition \(P\) holds, and 0 otherwise. The functions \(\gcd(a,b)\) and \(\operatorname{lcm}(a,b)\) represent the greatest common divisor and least common multiple of \(a\) and \(b\), respectively.
Given an integer \(n\), compute \(f(i) \bmod 998244353\) for all \(1 \le i \le n\).
inputFormat
The input consists of a single integer (n). It is guaranteed that (n) is small enough to allow a brute force solution using triple nested loops.
outputFormat
Output (f(1), f(2), \ldots, f(n)) separated by spaces, each taken modulo (998244353).
sample
3
0 0 1