The continued fraction of a rational
The desk reduces a positive rational, writes the continued-fraction terms, and checks that the last convergent is the reduced form. A neighbouring convergent pair has determinant 1 or -1. The Bezout coefficients are the same run. No decimal is stored.
The result appears here when the page script runs.
A primality certificate
A certificate is a short record that proves an integer prime or composite, and anyone can check it with modular powers. For a prime n, a Pratt certificate names a witness a with a to the power n - 1 equal to 1 mod n, and a to the power (n - 1)/q different from 1 mod n for every prime q dividing n - 1. Each q gets the same treatment, down to 2. For a composite, the page gives its smallest factor and its smallest Miller-Rabin witness. A second reading takes only the certificate and recomputes every power and product.
The certificate appears here when the page script runs.
How it is computed
Method
Euclid writes each quotient. Convergents use the recurrence h equals a times the previous h plus the one before that, and the same for k. The determinant of neighbours is checked. Extended Euclid returns integers x and y with x times the reduced numerator plus y times the reduced denominator equal to the gcd.
Certificates
Trial division decides prime or composite and factors each n - 1. For a prime, the witness is the smallest a that passes every condition, so it is a primitive root mod n. Each prime q dividing n - 1 is certified once, the first time it is needed, and 2 is the base case. For a composite, write n - 1 as 2 to the s times an odd d, take a to the d, and square it s times to end at a to the n - 1. For a prime, that list starts at 1 or reaches n - 1 before the last square. The Miller-Rabin witness is the smallest base a from 2 up whose list does neither. The second reading checks that the listed factors multiply back to n - 1, that every q has its own certificate, and that every listed power matches a fresh square-and-multiply.
Assumptions
The input is one rational. Terms stay under 64. Integers stay inside the safe range. A zero denominator is refused. The integer to certify stops at 1000000000, where trial division of n - 1 stays quick in a browser.
Limits
The desk does not approximate pi: 355 over 113 is an integer pair, not a measurement of a circle.
Reproducibility
The inputs are kept in the address bar, so the same link reruns the same calculation.