B-Smooth Number Generation

$\begingroup$

A number is defined as being $B-Smooth$ if none of its prime factors are greater than the value of $B$. For example, $105$ is $7-Smooth$, because $105=3\cdot5\cdot7$.

Given a number $B$, how could you generate all $B-Smooth$ numbers up to a given number $N$?

Would it be best to check every number below $N$ to see if it is $B-Smooth$ by factorizing it? Would it be more efficient to generate all $B-Smooth$ numbers using a combination of powers on the products of all the primes up to $B$? Could you use a sieve method and simply remove numbers that are multiples of any prime greater than $B$ (like the sieve of Eratosthenes)?

$\endgroup$ 2 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like