Native prime tables #
This fixed program tests every candidate through the supplied bound, writes its primality bit, and counts the primes. Trial division, table addresses, writes and loops are charged. There is no primality oracle or assumed sieve.
Main definitions #
PrimeTable.program: the complete native table builder.PrimeTable.memory: its output bitmap and memory frame.
Main results #
PrimeTable.exec: exact bitmap and prime count in an explicit quadratic instruction bound.
Registers of the trial-division subroutine.
Instances For
Current trial-division candidate.
Instances For
Current candidate's primality bit.
Instances For
Largest candidate.
Instances For
Output bitmap base.
Instances For
First candidate not yet written.
Instances For
Address scratch.
Instances For
Number of primes written.
Instances For
One past the largest candidate.
Instances For
Constant one.
Instances For
Constant zero.
Instances For
Constant two.
Instances For
Handle zero and one directly; test all larger candidates by charged native trial division.
Instances For
Test, write the bit, update the count, and advance the candidate.
Instances For
A finite native prime-table program with its bound and base supplied in registers.
Instances For
Write every primality bit through m, count exactly Nat.primesLE m, and preserve
all cells outside the bitmap. Trial division gives the explicit quadratic bound
(m+1)(7m+15)+8; the final halt is excluded.