For positive integers , the greatest common divisor scales by the common multiplier . If , then is a common divisor of . Meanwhile Bézout's identity expresses as an integer linear combination of , so their greatest common divisor divides . These two comparisons prove the identity without prime factorization.
For a semiprime with distinct known primes, this quantum state is uniform over the reduced residue classes. With binary digits in , its fraction among all computational labels is . An ancilla qubit whose one probability is dilutes the joint good probability to exactly . A reversible range-and-greatest common divisor predicate marks the good labels with ancilla qubit one, and a single exact amplitude amplification iteration produces . Known prime factors provide the cardinality; the membership test itself needs only . Polynomial gate complexity presumes ideal one-qubit rotations at the specified amplitudes.