Smooth Number Calculator
Test
- A smooth number is one whose largest prime factor stays at or below a bound B; factor the number, read off its biggest prime factor, and compare.
- Factorizing 360 gives 2^3 x 3^2 x 5, so the complete factorization is on the table.
- The largest prime factor of 360 is 5, and the bound here is B = 5.
- Since 5 is at or below 5, 360 is a 5-smooth number; smooth numbers matter because factor-base algorithms like the quadratic sieve live on them.
The Smooth Number Calculator tells you whether an integer is B-smooth for a bound B you choose, and reports the largest prime factor that decides the answer. An integer is B-smooth when none of its prime factors exceeds B. For example, 360 = 2^3 x 3^2 x 5, so its largest prime factor is 5, making it 5-smooth; it is also 7-smooth but not 3-smooth. Likewise, 100 = 2^2 x 5^2 has largest prime factor 5, so it is not 3-smooth, while 1,024 = 2^10 is 2-smooth, because numbers that are 2-smooth are exactly the powers of 2. Enter a number and a bound, and the calculator gives you the prime factorization, the largest prime factor, and a clear yes or no for B-smoothness.
The underlying method is the accepted standard because B-smoothness is defined directly through prime factorization: a number qualifies exactly when every prime factor is at most B. That is why smooth numbers matter — they are the working material of factor-base factoring algorithms such as the quadratic sieve, where a supply of smooth values drives the computation. This page shows the formula, step-by-step workings, worked examples and sources, so you can follow each stage of the check rather than trust a hidden result. Every answer is traceable to the same rule: factor the integer, compare its largest prime factor with B, and read off the conclusion.
Worked examples
360 is 5-smooth
(360 · 5)
| Smoothness verdict for n | 5-smooth |
| Factorization of n | 2^3 x 3^2 x 5 |
| Largest prime factor | 5 |
| Prime factors with multiplicity | 6 |
100 is not 3-smooth
(100 · 3)
| Smoothness verdict for n | Not 3-smooth |
| Factorization of n | 2^2 x 5^2 |
| Largest prime factor | 5 |
| Prime factors with multiplicity | 4 |
1024 is 2-smooth
(1024 · 2)
| Smoothness verdict for n | 2-smooth |
| Factorization of n | 2^10 |
| Largest prime factor | 2 |
| Prime factors with multiplicity | 10 |
What does B-smooth mean?
A smooth number is defined by its prime factors, not by how large the number itself is. An integer is B-smooth when none of its prime factors exceeds B. The letter B is the bound you choose, and it is the only thing the definition cares about: you look at the prime factorization, find the single largest prime that divides the number, and compare that prime to B. If the largest prime factor is at most B, the number is B-smooth. If it is larger, the number is not. A smooth number calculator applies exactly this test, which is why it needs a bound as well as a number.
Take 360 as a running example. Its prime factorization is 360 = 2^3 x 3^2 x 5. The prime factors are 2, 3 and 5, so the largest prime factor is 5. That makes 360 5-smooth. It is also 7-smooth, because 5 does not exceed 7. But it is not 3-smooth, because 5 is greater than 3. The same number can be smooth for one bound and not for another, and both answers are correct for their own bound.
That relativity is the heart of the idea. Smoothness is always relative to the chosen bound, so a bare claim that a number is "smooth" says nothing until B is stated. The example of 100 makes the point from the other direction: 100 = 2^2 x 5^2 has largest prime factor 5, so it is not 3-smooth, even though it is 5-smooth. A reader who assumed 100 was smooth in general would be mixing up the number with the bound.
Small bounds produce very restrictive sets. The number 1,024 = 2^10 is 2-smooth, and in fact numbers that are 2-smooth are exactly the powers of 2. Once the bound is 2, the only permitted prime factor is 2 itself, so every 2-smooth number is 2 raised to some whole-number exponent. Raise the bound and the set grows quickly, because each new prime below B opens up new combinations of factors. Lower the bound and the set shrinks, sometimes to nothing for a given number.
This definition matters because smooth numbers are the working material of factor-base factoring algorithms such as the quadratic sieve. Those algorithms collect numbers whose prime factors all fall within a chosen factor base, and the B-smooth test is precisely how such candidates are recognized. The bound is not an afterthought in that setting; it is a design choice that shapes which numbers qualify. The same is true on this page: pick B, factor the number, compare the largest prime factor to B, and you have your answer.
How the test works
The test behind a smooth number calculator rests on one definition: an integer is B-smooth when none of its prime factors exceeds B. So the procedure is short. Factor the number completely into primes, read off the largest prime factor, and compare that value with the bound B. If the largest prime factor is less than or equal to B, the number is B-smooth. If it is greater, the number is not B-smooth. Nothing else enters the decision.
Take 360 first. Its factorization is 360 = 2^3 x 3^2 x 5. The prime factors are 2, 3 and 5, so the largest prime factor is 5. Compared with B = 5, the largest factor equals the bound, so 360 is 5-smooth. The same factorization settles two more questions. Because 5 does not exceed 7, 360 is also 7-smooth. But 5 does exceed 3, so 360 is not 3-smooth. A single factorization can therefore answer the smoothness question for several bounds at once.
Now take 100. Its factorization is 100 = 2^2 x 5^2, so its prime factors are 2 and 5 and the largest prime factor is 5. Against B = 3, that largest factor is too big, so 100 is not 3-smooth. The comparison is the whole test: the exponents do not matter, and neither does the size of the number itself. Only the largest prime factor is checked against B.
Finally take 1,024. Its factorization is 1,024 = 2^10, so its only prime factor is 2 and its largest prime factor is 2. That makes 1,024 2-smooth. This case also shows a general pattern: numbers that are 2-smooth are exactly the powers of 2. No other integer has 2 as its largest prime factor, because any other prime factor would be larger than 2.
Smooth numbers matter because they are the working material of factor-base factoring algorithms such as the quadratic sieve, which collect numbers whose prime factors all fall within a chosen factor base. Running the test above on candidate numbers is how such a factor base is screened. The table below repeats the three worked cases with their factorizations, largest prime factors and outcomes.
| Number | Factorization | Largest prime factor | Smoothness |
|---|---|---|---|
| 360 | 2^3 x 3^2 x 5 | 5 | 5-smooth; also 7-smooth; not 3-smooth |
| 100 | 2^2 x 5^2 | 5 | Not 3-smooth |
| 1,024 | 2^10 | 2 | 2-smooth (a power of 2) |
Special families
Special families of smooth numbers get their names from the largest prime allowed in the factorization. An integer is B-smooth when none of its prime factors exceeds B. Change B and you change the family, and a few of these families have been studied long enough to have their own identities.
The smallest family is the 2-smooth numbers. Since the only prime that may appear is 2, every 2-smooth number is built entirely from factors of 2. That makes the 2-smooth numbers exactly the powers of 2. A quick check shows the pattern: 1,024 = 2^10 is 2-smooth, and so is every other power of 2, while a number like 12 (2^2 x 3) is not, because the prime 3 exceeds the bound of 2. If you test a value in a smooth number calculator and the only prime factor that turns up is 2, you are looking at this family.
Raise the bound to 3 and you get the 3-smooth numbers, the numbers of the form 2^a x 3^b. These are the regular numbers of Babylonian mathematics, a family that mattered for the sexagesimal (base-60) system because their reciprocals terminate in that base. Not every familiar number qualifies. Take 100 = 2^2 x 5^2: its largest prime factor is 5, so it is not 3-smooth. The same test rules out many round-looking values that seem simple at first glance.
Raise the bound once more, to 5, and the 5-smooth numbers appear. This family adds the prime 5 to the allowed factors, so 2, 3 and 5 may all appear. The number 360 = 2^3 x 3^2 x 5 shows how the bound works: its largest prime factor is 5, so it is 5-smooth. It is also 7-smooth, since 7 is a looser bound that permits everything 5-smooth allows. It is not 3-smooth, because the factor 5 exceeds 3. Each larger bound contains the smaller families, so every 2-smooth number is also 3-smooth and every 3-smooth number is also 5-smooth.
These families are not just curiosities. Smooth numbers are the working material of factor-base factoring algorithms such as the quadratic sieve, where numbers that factor completely over a small set of primes are the ones that do useful work. Recognizing which family a number belongs to is the first step in that process, and a smooth number calculator makes the check quick by reporting the largest prime factor and the bound it satisfies.
Why cryptographers care
Smooth numbers are the working material of factor-base factoring algorithms such as the quadratic sieve. That single fact explains most of the interest cryptographers take in them. In these algorithms, the attacker chooses a bound B and assembles a factor base — the set of primes up to B — then searches for integers whose prime factors all fall inside that base. An integer is B-smooth when none of its prime factors exceeds B, so what the algorithm is harvesting is, precisely, smooth numbers. A smooth number can be written entirely as a product of the small primes in the factor base, which means it can be represented as a vector of exponents over those primes. Collect enough such vectors and linear algebra over a finite field can be used to combine them into a solution. A number that contains even one prime factor larger than B is useless to this process: it cannot be expressed in the factor base at all.
The same harvesting pattern appears in index-calculus attacks on discrete logarithms. There too an attacker fixes a factor base of small primes and looks for relations in which the quantities of interest factor completely over that base. Each relation found is one more equation, and enough equations let the attacker solve for the discrete logarithms of the factor-base elements and then for the target. In both settings, progress is measured by how many smooth numbers can be found, and how quickly. This is why the smooth number calculator matters as a practical companion: checking whether a candidate integer is B-smooth, and identifying its largest prime factor, is the basic screening step behind these relation-collection stages.
Concrete examples make the boundary clear. Take 360 = 2^3 x 3^2 x 5. Its largest prime factor is 5, so it is 5-smooth; it is also 7-smooth, but it is not 3-smooth, because the factor 5 exceeds 3. Take 100 = 2^2 x 5^2. Its largest prime factor is 5, so it is not 3-smooth either. And 1,024 = 2^10 is 2-smooth — numbers that are 2-smooth are exactly the powers of 2. These cases show how sharply the choice of B controls what counts as usable material: loosen the bound and more integers qualify, tighten it and the supply shrinks.
For a cryptographer, that trade-off is the whole game. The factor base must be large enough that smooth numbers are common enough to find in quantity, yet small enough that the linear algebra stays manageable. The smooth number calculator turns this from an abstract question into a quick check on any specific integer: does every prime factor stay within the bound, and what is the largest one? Because smooth numbers are the raw material of the quadratic sieve and of index-calculus discrete-log attacks alike, being able to test a number for smoothness is a direct way to see the arithmetic those attacks depend on.
FAQs
What is a smooth number?
A number whose largest prime factor is at most B is called B-smooth. The bound B sets the limit on how large a prime factor the number may contain. For example, 360 is 5-smooth because 360 = 2^3 x 3^2 x 5, and its largest prime factor, 5, does not exceed the bound of 5.
Is 100 smooth?
It depends on the bound you choose. 100 is 5-smooth but not 3-smooth, because its largest prime factor is 5. Since 5 is greater than 3, the number fails the 3-smooth test. With a bound of 5 or higher, 100 qualifies as smooth.
What are 2-smooth numbers?
They are exactly the powers of 2, like 1,024 = 2^10, since 2 is the only prime allowed under that bound. Any number built only from factors of 2 must be a power of 2. No other prime can appear, so the list is 1, 2, 4, 8, 16 and so on.
Is 1 smooth?
Yes. By convention 1 is B-smooth for every B, because it has no prime factors at all. Since there is no largest prime factor to compare against the bound, the condition is met automatically. This convention keeps definitions and formulas consistent across all bounds.
What is a rough number, the opposite idea?
A k-rough number has no prime factor below k, which makes it the mirror image of smoothness. Where a smooth number keeps all its prime factors small, a rough number excludes small primes entirely. The two ideas describe opposite ends of the same spectrum of prime factor sizes.
Where are smooth numbers used?
Smooth numbers appear in factoring and discrete-log algorithms, in signal processing where smooth lengths suit FFTs, and in Babylonian regular numbers. Each setting relies on the same property: prime factors that stay within a chosen bound. That structure makes these numbers useful for computation and for historical number systems alike.