Code: #include<bits/stdc++.h> #define ll long long #define M 10001000 #define maxn 10200100 #define MOD 100000009 using namespace std; int cnt, tot; int vis[maxn],mu[maxn], prime[maxn]; ll h[maxn], sumv[maxn]; void init() { int i,j; h[1]=1; for(i=2;…