Problem #228
Generating Sets
For given numbers n, a and a set S, define the set a^S = {{{a^t~mod~n:t~is~in~S}}}.
For n = 998244353 and S = Set of natural numbers, find
\sum_{i=1}^{n}{|i^S|}
Give ans modulo 10^9+7 .
Note: |X| denote the size of set X.