B-smooth numbers list
Up to 30 there are 18 numbers whose prime factors are all 5 or less, the 5-smooth or Hamming numbers. Enter a bound B and a limit N to get the full ordered list, the primes used and the count. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- B
- 5
- N
- 30
- Primes le b
- 2, 3, 5
- Quantity
- 18
A positive integer is B-smooth (also called B-friable) when every prime factor is at most B. The classic examples are the Hamming numbers, which are exactly the 5-smooth positives: products of powers of two, three, and five. This capability takes a smoothness bound B and an upper limit N and returns the complete ordered list of B-smooth integers from 1 through N, together with the primes at most B and a count field.
What B-smooth numbers are and why the list matters
In elementary number theory a positive integer m is called B-smooth when every prime dividing m is less than or equal to a fixed bound B. The integer 1 is treated as B-smooth for every B because it has an empty set of prime factors. Familiar special cases include the Hamming numbers (5-smooth), the powers of two (2-smooth), and highly composite-friendly pools used in the quadratic sieve and number-field sieve, where smooth relations are the bottleneck of the attack.
Listing every B-smooth value up to N makes the definition concrete: you see which composites survive the prime-factor filter, how sparse or dense the set is for a given pair (B, N), and how the count changes when you raise B by a single prime. Students often confuse smoothness with primality or with square-freeness; the full ascending list separates those notions immediately.
Researchers and engineers use the same enumeration to seed random-looking yet factor-friendly integers, to grade contest problems that ask for all Hamming numbers below a ceiling, and to sanity-check hand sieves before trusting a larger custom implementation.
Where to use the list and what it costs
If you only need a membership test for a single integer, you can still run this tool for small N and scan the returned array, or factor the integer separately and check that its largest prime factor is at most B. The browser path runs locally and needs no account. Treat the returned count as authoritative for the listed numbers rather than recomputing length in client code that might drift from this contract.
What you can do with it
Homework and contest verification
Compare a student’s list of Hamming or other B-smooth numbers up to N against the canonical full enumeration and count instead of grading partial hand sieves.
Teaching demos of smooth density
Show live how raising B from 2 to 3 to 5 fills more of the integers below N, and confirm that count matches an independent factorization filter.
FAQ
Is 1 considered B-smooth?
Yes. The integer 1 has no prime factors, so it is B-smooth for every valid bound B and always appears first in the list when N ≥ 1.
What are Hamming numbers in this tool?
Hamming numbers are exactly the 5-smooth positives. Set b to 5 and choose n; the numbers array is the Hamming sequence truncated at N.
Why are small B or N rejected?
n must be at least 1 and b at least 2.
How do I check whether a single number is B-smooth?
Run the list with a small limit and look for the number, or factor it separately and check that its largest prime factor is at most B. Both give the same answer.
Is a B-smooth number the same as a prime?
No. Smoothness only limits the size of the prime factors, so composite numbers qualify too. Powers of two such as 4 and 8 are 2-smooth, yet neither is prime.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/numth/b-smooth-list \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"b":5,"n":30}'const res = await fetch("https://api.kit.forhosting.com/numth/b-smooth-list", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"b": 5,
"n": 30
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/numth/b-smooth-list",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"b": 5,
"n": 30
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/numth/b-smooth-list", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"b":5,"n":30}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"b":5,"n":30}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/numth/b-smooth-list", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"b": 5,
"n": 30
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "numth.b_smooth_list",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
How the capability enumerates and when it refuses
The engine first sieves every prime less than or equal to B, then recursively multiplies those primes in non-decreasing order, starting from one, and records every product that stays at most N. That walk is deterministic and free of clocks, randomness, or network state, so identical requests always yield the same ordered array. Missing fields, non-integers, and values above the published maximum also fail the same way and are never charged. You send a JSON body with two required integer fields: b (the smoothness bound B, at least two) and n (the inclusive upper limit N, at least one). The response echoes b and n, exposes primes_le_b for transparency, returns numbers as the ascending list of B-smooth integers in the closed interval from one to N, and sets count to the length of that list. Values of n below one fail with invalid_input because the conventional positive-integer range starts at one. Values of b below two fail with invalid_input because there is no prime strictly less than two, so a bound of zero or one does not define a useful smoothness class under the usual definition. Keep N and B inside the documented ceilings so the full list stays practical for browser and API payloads alike.
Where to use the list and what it costs
Use the free browser tool when you want a quick visual check for a small bound and limit, or call the API when a script, gradebook, generator, or research notebook must resolve many pairs the same way every time. API usage draws from prepaid KIT balance at the published $0.002 base price per successful request; failed validation does not consume balance.
Integration use cases
Test-fixture generation for friable inputs
Feed small (B, N) pairs into the API and use every returned integer as an input case for functions that assume smooth or Hamming-style arguments.
Technical questions
How do I list all B-smooth numbers up to N?
POST a JSON body with integers b (smoothness bound, ≥ 2) and n (upper limit, ≥ 1). The response includes numbers, count, and primes_le_b.
Is the B-smooth numbers list free?
The browser widget is free and runs locally. API calls use prepaid KIT balance at the published $0.002 base price; invalid input is not charged.