What is mobius function? This function is notated as
. This function has lots of definitions.
(A function
How do we calculate
void preprocess(void) { int i, j; for(i=1 ; i<=111100 ; i++) { mu[i]=1; primechk[i]=1; } primechk[1]=0; for(i=2 ; i<=111100 ; i++) { if(primechk[i]==1) { mu[i]=-mu[i]; for(j=2 ; i*j<=111100 ; j++) { primechk[i*j]=0; if(j%i==0) { mu[i*j]=0; } else { mu[i*j]=-mu[i*j]; } } } } }
Okay,
Comments
Post a Comment