410434: GYM104021 F Function!
Description
Define the function
$$$$$$ f_a\left( x \right) = a^x~(a > 0 \wedge a \neq 1) $$$$$$
for all $$$x \in (-\infty, +\infty)$$$.
You are asked to calculate the value of
$$$$$$ \sum_{a=2}^n{\left( a \sum_{b=a}^n{\lfloor f_{a}^{-1}\left( b \right) \rfloor}\lceil f_{b}^{-1}\left( a \right) \rceil \right)} $$$$$$
where $$$f_a^{-1}\left( x \right)$$$ is the inverse function of $$$f_a\left( x \right)$$$, $$$\lfloor x \rfloor$$$ is the largest integer that is less than or equal to $$$x$$$, and $$$\lceil x \rceil$$$ is the smallest integer that is greater than or equal to $$$x$$$.
Since the value could be very large, please output the value modulo $$$998244353$$$.
InputAn integer $$$n~(2 \leq n \leq 10^{12})$$$ described above.
OutputAn integer denotes the value you have calculated modulo $$$998244353$$$.
ExamplesInput2Output
2Input
10Output
236