Advanced maths

Smooth number counting calculator below a limit

Smooth numbers have no prime factors above a selected bound.

Your numbers

Integer 1–10^12.
Integer 2–97; all primes≤bound are allowed.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Smooth numbers have no prime factors above a selected bound. This calculator counts the entire bounded multiplicative family using exact prime-exponent recursion rather than factoring just one input. Integer one is included, and a small-limit sample list is kept separate from the exact total.

THE FORMULAPsi(x,k)=Σ_(j≥0:p_k^j≤x) Psi(floor(x/p_k^j),k−1), Psi(x,0)=1.

A worked example

The five-smooth positive integers through ten are 1,2,3,4,5,6,8,9,10. There are nine, because seven alone has a prime factor above five. A bound that is not prime still means all primes at or below that bound; it does not introduce composite factors as new independent exponents.

Good to know

Integer limit up to 10^12 and smoothness bound two through 97, with 500,000 recurrence-call cap. Exact counts only. Listing is capped at the first 100 values and appears only for limits≤100,000. No asymptotic estimate disguised as an exact result.

Smoothness restricts prime factors, not integer magnitude alone

An integer is bound-smooth when every prime dividing it is no larger than the selected bound. Repeated powers of an allowed prime remain allowed, while one forbidden prime excludes the entire number. Integer one has no prime factors and is included by convention, which supplies the base case of the counting recurrence.

The bound can be composite; its role is to select all primes at or below it. Treating every integer below the bound as an independent factor would overcount numbers with several multiplicative descriptions. The implementation first builds the prime list and uses unique prime-exponent representations for the exact family count.

Exactly nine five-smooth integers are at most ten12345689107 is excluded; integer 1 is included
The five-smooth positive integers through ten are 1,2,3,4,5,6,8,9,10. There are nine, because seven alone has a prime factor above five. A bound that is not prime still means all primes at or below that bound; it does not introduce composite factors as new independent exponents.

The Prime factorization and divisors calculator covers the nearby task. Factoring one integer does not count the prime-restricted multiplicative set through a limit.

Prime exponent recursion avoids duplicate products

The recursion fixes the exponent of the largest remaining allowed prime, then counts the smaller-prime part beneath the reduced limit. Distinct exponents produce disjoint integer sets. Memoization shares repeated smaller subproblems, allowing many counts to be computed without listing every smooth integer individually up to a potentially large limit.

All limits and intermediate prime powers stay within the stated safe-integer range, and count totals use big integers. The recurrence has a separate call cap to prevent difficult smoothness/limit combinations from consuming unbounded browser work. Hitting that cap returns an error rather than an asymptotic smooth-number estimate.

The count is independent of the sample listing

The optional small-limit list contains at most the first hundred values, while the primary count covers the whole permitted interval. A truncated or absent list is not the counted set itself. In particular, a large-limit result can have a valid nonzero total even though no sample rows are produced by the bounded listing policy.

Independent verification factors every small integer and compares the resulting count with the prime-exponent recursion. Tests also cover limits one and prime bounds just below or above a new allowed prime. This page does not estimate the probability that an arbitrary sampled large integer is smooth or claim a uniform asymptotic approximation outside its exact input limits.

Count prime-exponent combinations without duplicates

A positive integer is B-smooth when every prime factor is at most B. With allowed primes p1,…,pr, each admissible integer has a unique exponent vector (e1,…,er) with nonnegative entries and product Πpi^ei≤N. Counting those exponent choices avoids testing every integer from one to a possibly enormous N.

Integer one is included because all exponents can be zero. A composite smoothness bound does not become an additional independent factor: B=6 permits primes 2,3,5, exactly as B=5 does. Treating six as another generator would count some products twice, since six already equals 2×3.

Enumerate the 5-smooth integers through twenty

The allowed primes are 2,3,5. The values at most twenty are 1,2,3,4,5,6,8,9,10,12,15,16,18,20, giving count fourteen. Seven, eleven, thirteen, fourteen, seventeen and nineteen are excluded because they contain a prime above five.

For B=2, only powers of two remain: 1,2,4,8,16, giving five values through twenty. Raising B from five to six changes nothing; raising it to seven adds seven and fourteen in this range. This stepwise behavior is expected because the allowed-prime set changes only when B crosses a prime.

Understand the counting recurrence and inclusivity

Let F(x,j) count products using the first j allowed primes. Splitting by the exponent of the jth prime gives F(x,j)=Σe≥0,pj^e≤x F(floor(x/pj^e),j−1), with F(x,0)=1 for x≥1. The base count is the empty product one. Every exponent vector appears in exactly one branch.

The upper limit is inclusive. If N itself is smooth, it contributes one; replacing ≤N with <N would change the answer at that boundary. Although the interface allows limits up to 10^12, it requires an integer limit. The recurrence-call count measures computational effort and is not an estimate or confidence interval for the exact count.

Separate the exact count from the displayed sample

For limits up to 100,000 the table can show up to the first 100 values. Beyond those display bounds, a short or absent sample does not mean that the count is small or zero. The counting recurrence remains the result, while listing values is an optional aid for inspecting a small case.

The search cap can be reached for some combinations of large N and many allowed primes; such a rejection is inconclusive rather than an asymptotic approximation. Smoothness concerns largest prime factors, not the number of prime factors or whether the number is square-free. For example, a large power of two remains 2-smooth even though it contains many repeated factors.

A few questions, answered

Does one count as smooth?

Yes. It has no prime factor exceeding the bound and is included by convention.

Is the sample list the whole answer?

No. The primary count is complete; listing is separately limited for display.

Why do bounds five and six give the same answer?

They permit the same prime factors: 2,3,5. A new allowed factor appears only when the bound reaches another prime.

Is one smooth even though it has no prime factors?

Yes. It is the empty prime product and is included in the count for every supported smoothness bound.

Find your calculator

Start typing to explore the library.