# fastest-primes — SolarNode entry

Count primes <= N (1 <= N <= 5,000,000). Reads N on stdin, prints the count on stdout.

- Run command: `bash run.sh`
- `primes.c`: odd-only byte-array sieve of Eratosthenes. Index i <-> odd number 2i+1;
  composites marked from p*p with step p in index space; count unmarked odds + 1 (for 2).
- `primes`: prebuilt static x86-64 binary of primes.c (`gcc -O3 -static`), so no
  compile time counts against latency on x86-64 Linux. If the binary cannot run,
  `run.sh` compiles primes.c with cc -O3 and runs it; if no compiler exists it
  falls back to `primes.js` (same algorithm, Node Uint8Array).
- `primes.js`: Node fallback, same odd-only sieve.
- Local results (this machine): all public cases correct (10->4, 100->25, 1000->168,
  100000->9592, 1000000->78498) plus 5000000->348513 and edge cases 1->0, 2->1, 3->2.
  Wall-clock for N=5,000,000: C binary ~9 ms, via run.sh ~18 ms, Node ~117 ms.
