for(int d = 1 ;d <= n; ++d) if(isprime[d]) for(int t = d; t <= n; t += d){ g[t] += isprime[d] * mu[t / d]; }