For an integer , its smallest prime factor is the least prime divisor of . If is prime, it equals ; if is composite, it is at most , because otherwise every product of two prime factors would exceed .
For example, . A sieve can tabulate smallest prime factors for all integers up to a bound. Repeatedly replacing by then produces its prime factorization. The value at one is a sentinel convention in implementations, since one has no prime factor.
Articles by others on the same topic
There are currently no matching articles.