/****************************************************************************** * * * COMPUTE MERTENS FUNCTION * * 04/02/10 (dkc) * * * ******************************************************************************/ #include <math.h> double sumhi(unsigned int x, unsigned int u, int *mob, int *M) { unsigned int i,j,k,m; double temp,sumb; sumb=0.0; for (m=1; m<=u; m++) { temp=(double)mob[m-1]; j=(unsigned int)sqrt((double)(x/m)); j=j+1; k=x/m; for (i=j; i<=k; i++) sumb=sumb+temp*(double)M[x/(m*i)-1]; } return(sumb); }