- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
long gr, ri, r1, r2, y, z, z_rev;
for (i = 2; i < qr_count; i++) {
step = 0;
ri = r[i];
gr = - mpz_fdiv_ui(lowM, pm[i][step]);
r1 = gr + ri;
r2 = gr + pm[i][step] - ri;
if (r1 < 0) {
r1 += pm[i][step];
}
if (r2 < 0) {
r2 += pm[i][step];
}
while (r1 < (long) Ml2) {
sieve[r1][i] += 1;
r1 += pm[i][step];
}
while (r2 < (long) Ml2) {
sieve[r2][i] += 1;
r2 += pm[i][step];
}
for (step = 1; step < degr[i]; step++) {
gr = - mpz_fdiv_ui(lowM, pm[i][step]);
y = ri*ri;
y -= Npm[i][step];
y = y/( (long) pm[i][step-1]);
if (y < 0) { y += pm[i][step]; }
z_rev = (ri<<1) % QR[i];
//?IOOA?EOO ?OI?AOEO IA UAAEEIE?AIEA
if (z_rev == 0) { y = 0; }
else {
z = 1;
while ((z_rev*z % QR[i]) != 1) { z++;}
y *= z*pm[i][step-1];
y = y % pm[i][step];
}
ri -= y;
if (ri < 0) { ri += pm[i][step]; }
r1 = gr+ri;
r2 = gr+pm[i][step]-ri;
if (r1 < 0) { r1 += pm[i][step]; }
if (r2 < 0) { r2 += pm[i][step]; }
while (r1 < (long) Ml2) {
sieve[r1][i] += 1;
r1 += pm[i][step];
}
while (r2 < (long) Ml2) {
sieve[r2][i] += 1;
r2 +=pm[i][step];
}
}
}