/*CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C                                                                             C
C  COMPUTE DIFFERENCES IN NUMBER OF FRACTIONS (0 to 1/I, 1/I to 2/I)	      C
C  05/13/15 (DKC)							      C
C                                                                             C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC*/
#include <stdio.h>
#include <math.h>
void sub64(unsigned int *A, unsigned int *B);
mertenav(unsigned int, unsigned int *count, unsigned int I);
//
unsigned int MAXN=5000000; // 2000000000 maximum
unsigned int I=1000;     // n value
//
void main() {
int t;
unsigned int N,count[4],J,D[2];
FILE *Outfp;
Outfp = fopen("out1ba.dat","w");
J=(I+1)/2;
for (N=J; N<=MAXN; N+=J) {
   mertenav(N, count, I);
   t=(int)count[1]-(int)count[3];
   D[0]=count[2];
   D[1]=count[3];
   sub64(&count[0], D);
   printf(" %d %d %d %d %d %d %d %d\n",N,t,count[0],count[1],count[2],count[3],D[0],D[1]);
   fprintf(Outfp," %d\n",D[1]);
   }
fclose(Outfp);
return;
}