#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // #pragma GCC target("avx") // #pragma GCC optimize("O3") // #pragma GCC optimize("unroll-loops") //if(a < 0 || h <= a || b < 0 || w <= b)return; using namespace std; using namespace atcoder; using ll = long long; using ld = long double; using ull = unsigned long long; using mint = modint998244353; using min1 = modint1000000007; using VL = vector; template using pq = priority_queue;//降順?(最大取り出し) template using pqg = priority_queue, greater>;//昇順?(最小取り出し) template using vector2 = vector>; template using vector3 = vector>>; template using vector4 = vector>>>; template using vector5 = vector>>>>; template using vector6 = vector>>>>>; template using pairs = pair; #define rep(i, n) for (ll i = 0; i < ll(n); i++) #define rep1(i,n) for(int i = 1;i <= int(n);i++) #define repm(i, m, n) for (int i = (m); (i) < int(n);(i)++) #define repmr(i, m, n) for (int i = (m) - 1; (i) >= int(n);(i)--) #define rep0(i,n) for(int i = n - 1;i >= 0;i--) #define rep01(i,n) for(int i = n;i >= 1;i--) // NのK乗根N < 2^64, K <= 64 uint64_t kth_root(uint64_t N, uint64_t K) { assert(K >= 1); if (N <= 1 || K == 1) return N; if (K >= 64) return 1; if (N == uint64_t(-1)) --N; auto mul = [&](uint64_t x, uint64_t y) -> uint64_t { if (x < UINT_MAX && y < UINT_MAX) return x * y; if (x == uint64_t(-1) || y == uint64_t(-1)) return uint64_t(-1); return (x <= uint64_t(-1) / y ? x * y : uint64_t(-1)); }; auto power = [&](uint64_t x, uint64_t k) -> uint64_t { if (k == 0) return 1ULL; uint64_t res = 1ULL; while (k) { if (k & 1) res = mul(res, x); x = mul(x, x); k >>= 1; } return res; }; uint64_t res; if (K == 2) res = sqrtl(N) - 1; else if (K == 3) res = cbrt(N) - 1; else res = pow(N, nextafter(1 / double(K), 0)); while (power(res + 1, K) <= N) ++res; return res; } // ユークリッドの互除法による最大公約数算出 ll GCD(ll a,ll b){ if(b == 0)return a; return GCD(b, a % b); } //拡張ユークリッドの互除法による(ax + by = GCD(a,b))を満たすx,yの算出 pair extgcd(long long a, long long b) { if (b == 0) return make_pair(1, 0); long long x, y; tie(y, x) = extgcd(b, a % b); y -= a / b * x; return make_pair(x, y); } struct UnionFind { vector par; // par[i]:iの親の番号 (例) par[3] = 2 : 3の親が2 UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化 for(int i = 0; i < N; i++) par[i] = i; } int root(int x) { // データxが属する木の根を再帰で得る:root(x) = {xの木の根} if (par[x] == x) return x; return par[x] = root(par[x]); } void unite(int x, int y) { // xとyの木を併合 int rx = root(x); //xの根をrx int ry = root(y); //yの根をry if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時:xの根rxをyの根ryにつける } bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す int rx = root(x); int ry = root(y); return rx == ry; } }; ll n; struct UnionFind2 { vector2 par; // par[i]:iの親の番号 (例) par[3] = 2 : 3の親が2 UnionFind2(int N) : par(N,vector(N)) { //最初は全てが根であるとして初期化 for(int i = 0; i < N; i++)for(int j = 0;j < N;j++) par[i][j] = i * N + j; } int root(int y,int x) { // データxが属する木の根を再帰で得る:root(x) = {xの木の根} if (par[y][x] == y * n + x) return y * n +x; return par[y][x] = root(par[y][x] / n,par[y][x] % n); } void unite(int y0, int x0,int y1,int x1) { // xとyの木を併合 int rx = root(y0,x0); //xの根をrx int ry = root(y1,x1); //yの根をry if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま par[rx / n][rx % n] = ry; //xとyの根が同じでない(=同じ木にない)時:xの根rxをyの根ryにつける } bool same(int y0, int x0,int y1,int x1) { // 2つのデータx, yが属する木が同じならtrueを返す int rx = root(y0,x0); int ry = root(y1,x1); return rx == ry; } }; //座標圧縮 vector Ccomp(vector a){ vector b = a; sort(b.begin(),b.end()); b.erase(unique(b.begin(),b.end()),b.end());//ダブり消去 vector rtn; rep(j,a.size()){ ll pb = lower_bound(b.begin(),b.end(),a[j]) - b.begin(); rtn.push_back(pb); } return rtn; } /// ここから//////////////////////////////////////////// using F = ll; using S = ll; string s; ll modPow(ll a, ll n, ll mod) { if(mod==1) return 0;ll ret = 1; ll p = a % mod; while (n) { if (n & 1) ret = ret * p % mod; p = p * p % mod; n >>= 1; } return ret; } void cincout(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); cout<< fixed << setprecision(15); } //seg,遅延segの設定-----ここから S op(S a,S b){return a + b;}//何を求めるか(最大値とか) S e(){return 0;}//モノイド(初期値) S bop(S a,S b){return a * b;}; S be(){return 1;} ll v; //bool f(ll a){return v > a;}//めんどいやつ //S mapping (F a,S b){return a + b;}//遅延処理 F composition (F a,F b){return a + b;}//遅延中の枝にさらに処理 F id(){return 0;}//遅延のモノイド vector Op(vector a,vector b){a.insert(a.end(),b.begin(),b.end()); return a;} vector E(){return vector (0);} //segここまで string abc = "abcdefghijklmnopqrstuvwxyz"; //string abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; ll mod = 998244353; ll INF =ll(2e18); //かなしみ int main() { cincout(); cin >> n; vector2> a(n+1); for(int j = 2;j * j <= n;j++){ if(a[j].size() == 0){ for(int i = j;i <= n;i++){ ll now = i; while(now % j == 0){ if(now == i)a[i].push_back({j,0}); a[i][a[i].size()-1].second++; now /= j; } } } } for(int j = 2;j <= n;j++){ ll now = 1; for(auto i : a[j]){ now *= modPow(i.first,i.second,INF); } if(now != j)a[j].push_back({j / now,1}); } vector b(n+1,0); ll bs = 1; ll bk = 0; for(int j = 2;j <= n;j++){ for(auto i : a[j]){ if(b[i.first] == 0)bk++; b[i.first] += i.second; } } for(int j = 2;j <= n;j++){ if(b[j] != 0)bs *= (b[j]+1); } mint ans = 0; sort(b.begin(),b.end()); vector d(n+2,1); for(int j : b){ if(j == 0)continue; vector e(j+2,0); for(int i = 1;i <= j;i++){ if(i == 0)e[n+1]++; else e[j / i]++; } ll sumnow = 1; for(int i = j;i >= 1;i--){ e[i] += sumnow; sumnow += e[i] - sumnow; } ll now = 1; while(now <= j){ //if(d[now] == 0)d[now] = e[now]; d[now] *= e[now]; now++; } } //for(int j = n-1;j >= 1;j--)d[j] += d[j + 1]; ll minus = 0; for(int j = n;j >= 1;j--){ //cout << d[j] << endl; ans += j * max(0LL,(d[j]-1) - minus); minus += (d[j]-1-minus); } cout << ans.val() << endl; // return 0; // for(int j : b){ // if(j == 0)continue; // else{ // bs /= (j+1); // bk--; // ll nowbs = bs; // for(int k = 1;k <= j;k++){ // ans += nowbs * (j / k); // nowbs-=bk; // } // cout << j << " " << ans.val() << endl; // // cout << j << " " << bs * ((j * (j + 1)) / 2) << endl;; // // ans += bs * ((j * (j + 1)) / 2); // } // } // cout << ans.val() << endl; return 0; }