Algorithms to Uniformly Generate Random Factored Smooth Integers

preprint2026arXivOpen access

Abstract

Let x≥y>0x\ge y>0 be integers. A positive integer is yy-smooth if all its prime divisors are at most yy. Let Ψ(x,y)Ψ(x,y) count the number of yy-smooth integers up to xx. We present several algorithms that will generate an integer n≤xn\le x at random, with known prime factorization, such that nn is yy-smooth. We begin by describing algorithms to compute Ψ(x,y)Ψ(x,y) exactly and to enumerate yy-smooth integers up to xx in lexicographic order by prime divisor. Both of these are based on Buchstab's identity, and were likely known before. Then we present an algorithm that accepts as input a parameter rr, 0≤r<10\le r<1, and returns the integer nn that is at position ⌊rΨ(x,y)⌋\lfloor rΨ(x,y)\rfloor in the lexicographic ordering of all yy-smooth integers up to xx. Here position 0 is the first position. Thus, nn is generated uniformly so long as rr is chosen uniformly. This algorithm has a running time of O(Ψ(x,y)log⁡log⁡y)O(Ψ(x,y)\log\log y) arithmetic operations. We then explore the tradeoff between speed and rigor. By relaxing the uniformity of the output and allowing for multiple heuristics in our runtime analysis, we improve the running time to O((log⁡x)3log⁡log⁡x) O\left( \frac{ (\log x)^3 }{\log\log x} \right) arithmetic operations. We conclude with a sample run by generating a 1000010000-smooth integer ≤10100\le 10^{100}.

Explore this paper’s authors, topics and related work.

Building this map preview

BZPEER is loading the nearby papers, people, topics and institutions for this page.

Reviews 0

Write a reviewWrite

No reviews yet.

Discussion 0

Add a commentWrite

No comments yet.