Generating Random Factored Numbers, Easily
Our goal is to generate a uniformly random number between 1 and N, along with its prime factorization. Since there are no known efficient factoring algorithms, one cannot simply generate a random number and then factor it. Eric Bach’s award-winning dissertation introduces and solves this problem. We present a four-line solution that is still efficient.