/******************************************************************************
* *
* COMPUTE MERTENS FUNCTION *
* 12/07/15 (dkc) *
* *
******************************************************************************/
#include <math.h>
long long newlocl(unsigned long long x, unsigned int u, char *mob, int *M) {
char temp;
unsigned int j,k,m;
unsigned long long xom;
long long sumb;
int i;
sumb=0;
for (m=1; m<=u; m++) {
temp=mob[m-1];
if (temp==0)
continue;
j=u/m+1;
xom=x/m;
k=(unsigned int)sqrt((double)xom);
#pragma omp parallel for reduction (+:sumb)
for (i=(int)j; i<=(int)k; i++) {
sumb=sumb+(long long)(M[xom/(unsigned int)i-1]*temp);
}
}
return(sumb);
}