#P3935. Summing Divisor Function Over an Interval

    ID: 17183 Type: Default 1000ms 256MiB

Summing Divisor Function Over an Interval

Summing Divisor Function Over an Interval

Given two integers \(l\) and \(r\), compute

\[ S = \sum_{i=l}^{r} f(i) \quad (\bmod\; 998\,244\,353), \]

where for any positive integer \(x\) with prime factorization

\[ x = p_1^{k_1} p_2^{k_2} \cdots p_n^{k_n}, \]

the function \(f(x)\) is defined as

\[ f(x) = (k_1+1)(k_2+1)\cdots (k_n+1). \]

Note: By convention, \(f(1)=1\) since 1 has no prime factors.

inputFormat

The input consists of a single line containing two space-separated integers \(l\) and \(r\) \((1 \leq l \leq r)\). You can assume that the interval \([l, r]\) is sufficiently small to allow a direct approach.

outputFormat

Output a single integer, the value of \(S = \sum_{i=l}^{r} f(i)\) modulo \(998\,244\,353\).

sample

1 1
1