Rough Number Calculator
Number
- A k-rough number is a positive integer whose prime factors are all at least k, so the whole question turns on its smallest prime factor.
- Factoring 720 gives 2^4 x 3^2 x 5, so its smallest prime factor is 2 and its largest prime factor is 5.
- Comparing the smallest prime factor with k: 2 < 5, so 720 is not 5-rough.
- Counting every integer from 2 to 720 the same way, 239 of them are 5-rough - each has all of its prime factors at least 5.
A positive integer is k-rough if none of its prime factors is smaller than k. Put another way, its smallest prime factor is at least k. This rough number calculator lets you enter a number and a value for k, then tells you whether the number is k-rough and how many k-rough integers lie in the range you specify. The rule is easy to see in practice. The number 720 equals 2^4 x 3^2 x 5, and its smallest prime factor is 2, so 720 is not 5-rough. Of the integers from 2 to 720, 239 are 5-rough. The number 49 has smallest prime factor 7, so 49 is 7-rough, and 13 integers up to 49 are 7-rough. Every prime is k-rough for any k up to the prime itself: 97 is prime, and 32 integers up to 97 are 5-rough.
The method behind the answer is the standard one for this kind of calculation. It works directly from the definition of k-rough numbers by factoring each integer and checking its smallest prime factor against k, which is exactly the criterion the definition states. That is why the results match the accepted counts, such as the 239 5-rough integers from 2 to 720. This page shows the formula, step-by-step workings, worked examples and sources, so you can follow each stage of the calculation yourself rather than taking the result on trust. Whether you are checking a single number or counting k-rough integers across a range, the page gives you both the answer and the reasoning that produced it.
Worked examples
720 is not 5-rough, and 239 numbers up to 720 are
(720 · 5)
| k-rough verdict | No |
| Smallest prime factor | 2 |
| Largest prime factor | 5 |
| Count of 5-rough numbers up to 720 | 239 |
49 is 7-rough
(49 · 7)
| k-rough verdict | Yes |
| Smallest prime factor | 7 |
| Largest prime factor | 7 |
| Count of 7-rough numbers up to 49 | 13 |
The prime 97 is 5-rough
(97 · 5)
| k-rough verdict | Yes |
| Smallest prime factor | 97 |
| Largest prime factor | 97 |
| Count of 5-rough numbers up to 97 | 32 |
What is a rough number?
A positive integer is k-rough if none of its prime factors is smaller than k. Put another way, its smallest prime factor is at least k. The letter k sets the threshold, so the same number can be rough at one threshold and not at another. Take 720, which factors as 2^4 x 3^2 x 5. Its smallest prime factor is 2, so 720 is not 5-rough. Change the threshold and the answer can change with it, which is why a rough number calculator always needs to know which k you mean.
Because the definition looks only at the smallest prime factor, it is a test about divisibility by small primes rather than about size. A number can be large and still fail the test, or modest and pass it. The convention in the literature treats 1 as rough, even though 1 has no prime factors at all. That choice keeps the counting tidy, since 1 then belongs to every k-rough set instead of being a special exception.
Rough numbers sit opposite smooth numbers. A smooth number is one whose prime factors are all small, while a rough number has no small prime factors at all. The two ideas describe the same factorization from opposite ends: smoothness asks whether every prime factor stays below a bound, and roughness asks whether every prime factor stays at or above one. Many numbers are neither strongly smooth nor strongly rough, which is part of what makes the pair useful for describing how a number is built.
Primes are the clearest examples of rough numbers. Every prime is k-rough for any k up to the prime itself, because its only prime factor is the prime, and that factor cannot be smaller than k once k is at most the prime. So 97 is prime, and it qualifies as k-rough for every k from 2 through 97. The same logic shows why 49, with smallest prime factor 7, is 7-rough: its prime factors are 7 and 7, and neither is below 7.
Counting how many integers meet a threshold is where a rough number calculator earns its place, since the totals are not obvious from the definition alone. Of the integers from 2 to 720, 239 are 5-rough. Up to 49, 13 integers are 7-rough. Up to 97, 32 integers are 5-rough. These counts show how the threshold changes the size of the group: raise k and fewer numbers qualify, lower it and more do. The counts also confirm that roughness is a property of individual numbers, while the totals describe how common that property is across a range.
Worked examples
A rough number calculator works by factoring a number completely and then reading off its smallest prime factor. That single value decides every roughness question you can ask about the number, because a positive integer is k-rough if none of its prime factors is smaller than k — equivalently, its smallest prime factor is at least k. The three examples below show how the verdict and the count come out for a composite with many small factors, a perfect square, and a prime.
Start with 720. Its full factorization is 720 = 2^4 x 3^2 x 5. The smallest prime factor is 2, and 2 is below 5, so 720 is not 5-rough. The calculator also reports how many integers in range qualify: 239 of the integers from 2 to 720 are 5-rough. Notice that the verdict for 720 depends only on that smallest factor of 2 — the higher powers of 2, the 3s and the 5 play no part in the yes-or-no answer, though they matter for the factorization display.
Next, 49. It factors as 7 x 7, so its smallest prime factor is 7. That makes 49 7-rough, since 7 is at least 7. The count for this range is small: 13 integers up to 49 are 7-rough. This example is a useful check on the boundary rule — a number whose smallest prime factor equals k is included, not excluded.
Finally, 97. It is prime, so its only prime factor is 97 itself. Every prime is k-rough for any k up to the prime itself, which means 97 is 5-rough and would remain rough for any threshold up to 97. For comparison with the 720 case, the calculator reports that 32 integers up to 97 are 5-rough. Running each of these through the rough number calculator takes the same two steps every time: factor fully, read the smallest prime factor, then compare it with k.
The table below collects the three worked examples with their factorizations, smallest prime factors, verdicts and counts.
| Number | Factorization | Smallest prime factor | Verdict | Count in range |
|---|---|---|---|---|
| 720 | 2^4 x 3^2 x 5 | 2 | Not 5-rough | 239 of the integers from 2 to 720 are 5-rough |
| 49 | 7 x 7 | 7 | 7-rough | 13 integers up to 49 are 7-rough |
| 97 | 97 (prime) | 97 | 5-rough (and k-rough for any k up to 97) | 32 integers up to 97 are 5-rough |
Rough numbers and sieves
Counting rough numbers is not a matter of testing every integer one at a time. Because roughness is defined entirely by small prime factors, the count below any limit can be built by inclusion-exclusion over the primes smaller than k. Start with all the integers in the range, then subtract those divisible by 2, subtract those divisible by 3, subtract those divisible by 5, and so on for every prime below k. That first pass removes too much, because a number divisible by both 2 and 3 has been subtracted twice, so you add back the counts for each pair of small primes. The correction overshoots in turn, so you subtract the counts for each triple, add back the quadruples, and continue alternating until every combination of the small primes has been accounted for. What remains is exactly the set of integers with no prime factor below k. This is the same principle behind the sieve of Eratosthenes, expressed as arithmetic rather than as a list of crossings-out, and it is what a rough number calculator automates when you ask for a count at a given limit and threshold.
The method is exact, but its cost grows with the number of primes below k. Each new prime doubles the number of combinations to consider, so the work climbs quickly as k rises. In practice the counting is organized so that divisibility by products of small primes is handled in bulk rather than one combination at a time, which keeps the computation manageable for ordinary ranges. The output is a single count, but the reasoning behind it is a structured sweep over the small primes, not a guess or an estimate.
Sieve theory cares about numbers with no small factors because those numbers are, in a precise sense, the ones a sieve has failed to remove. When a sieve strikes out multiples of 2, 3, 5, and the other primes below k, the survivors are the k-rough integers. Understanding how many survive, and how they are distributed, tells you how much room a sieve leaves for the objects it is meant to detect. A rough count is therefore a baseline: it describes the residue left after the small primes have done their work, before any question is asked about the larger structure of those survivors.
The definitions and counts are easy to check against small examples. 720 = 2^4 x 3^2 x 5 has smallest prime factor 2, so 720 is not 5-rough. Among the integers from 2 to 720, 239 are 5-rough. 49 has smallest prime factor 7, so 49 is 7-rough, and 13 integers up to 49 are 7-rough. Every prime is k-rough for any k up to the prime itself; 97 is prime, and 32 integers up to 97 are 5-rough. These figures illustrate both sides of the idea: raising k admits more numbers, and primes always survive every threshold they do not exceed.
Rough vs smooth numbers
Rough numbers are best understood next to their mirror image, smooth numbers. A positive integer is k-rough if none of its prime factors is smaller than k — equivalently, its smallest prime factor is at least k. A y-smooth number is the opposite kind of object: it is a number whose prime factors are all at most y. So the same threshold plays two roles. Below the threshold, factors are allowed (smooth); at or above it, factors are forbidden (rough). A rough number calculator applies the rough test, checking the smallest prime factor of a number against k.
A worked example makes the distinction concrete. Take 720 = 2^4 x 3^2 x 5. Its smallest prime factor is 2, so 720 is not 5-rough — the factor 2 falls below the threshold of 5. Smoothness runs the other way: 720 is 5-smooth, because every one of its prime factors (2, 3 and 5) is at most 5. The two labels describe different properties of the same integer, and a number can easily be smooth for one bound while failing a rough test for the same bound.
Roughness is common enough that counting it matters. Of the integers from 2 to 720, 239 are 5-rough. Primes are always rough: every prime is k-rough for any k up to the prime itself. Since 97 is prime, it is k-rough for every k up to 97, and 32 integers up to 97 are 5-rough. Smaller thresholds admit more numbers, and the count of k-rough integers up to a limit is the quantity a rough number calculator is typically asked to produce.
The counting side connects to a classical tool. The Buchstab function is tied to counting rough numbers: it describes how the proportion of k-rough integers behaves as the limit grows relative to k. That connection is why rough-number counts appear in the study of factoring and sieve methods, where knowing how many numbers survive a small-prime filter is the first question. Smooth numbers answer the complementary question — how many numbers are built entirely from small primes — and the two counts together frame the same sieve from opposite sides.
A quick contrast helps fix the terms. 49 has smallest prime factor 7, so 49 is 7-rough, and 13 integers up to 49 are 7-rough. Under a smoothness reading with y = 7, 49 would be 7-smooth as well, since all its prime factors are at most 7 — a reminder that rough and smooth are defined by where the threshold sits relative to the factors, not by the size of the number. When you use a rough number calculator, state k clearly: changing k changes which numbers qualify and changes every count that follows.
FAQs
What does k-rough mean?
An integer is k-rough when all of its prime factors are at least k. In other words, its smallest prime factor is k or more. So the label describes a threshold: the number has no prime factor below k, which means it cannot be divided evenly by any prime smaller than k.
Is 720 a 5-rough number?
No. 720 = 2^4 x 3^2 x 5, and its smallest prime factor is 2, which is below 5. Because 720 contains a prime factor smaller than the threshold, it fails the 5-rough test. A 5-rough number must have every prime factor at least 5.
Is 49 a 7-rough number?
Yes. The only prime factor of 49 is 7, which meets the threshold exactly. Since 49 = 7 x 7, every prime factor is at least 7, so 49 qualifies as 7-rough. Meeting the threshold exactly is enough; the smallest prime factor only needs to be 7 or more.
How many 5-rough numbers are there up to 720?
There are 239. This count includes every integer from 2 to 720 whose prime factors are all at least 5. Numbers with a prime factor of 2 or 3 are excluded, so the total is smaller than the full range from 2 to 720.
Is every prime a rough number?
A prime p is k-rough for every k up to p, since its only prime factor is p itself. Because that single factor is at least k whenever k does not exceed p, the prime passes the test. So any prime is rough for every threshold up to its own value.
What is the opposite of a rough number?
A smooth number, whose prime factors are all small. The two notions split integers by their smallest and largest prime factors: rough numbers have no small prime factors, while smooth numbers are built only from small ones. Together they describe how an integer's prime factors are distributed.