/*CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C C COMPUTE UPPER BOUND MINUS LOWER BOUND C C 05/29/14 (DKC) C C C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC*/ #include <stdio.h> #include <math.h> unsigned int euler(unsigned int a); double mertens1(unsigned int); void main() { unsigned int N,MAXN; unsigned int i,temp; double sum,msum; FILE *Outfp; Outfp = fopen("out1b6.dat","w"); MAXN=1280; for (N=2; N<=MAXN; N++) { sum=0.0; for (i=1; i<=N; i++) { msum=mertens1(N/i); temp=euler(i); if ((temp/4)*4!=temp) sum=sum+msum*(double)i/(double)temp; // printf(" %d %d %e %e \n",i,N/i,sum,msum); } if (sum<0.0) sum=-sum; printf("N=%d, sum=%e \n",N,sum); fprintf(Outfp," %e\n",sum); } fclose(Outfp); return; }