Number Pattern Generator
Generate arithmetic, geometric, Fibonacci, prime, and custom number sequences.
이 도구에 대해
Produce up to 100 terms of any classic number sequence — or define your own formula. Choose from Arithmetic (constant difference), Geometric (constant ratio), Fibonacci (each term is the sum of the two before), Triangular, Square, and Prime sequences. For custom sequences, enter a JavaScript-style formula using 'n' as the term index (1-based). The tool displays the full sequence, along with its sum, average, minimum, and maximum. Copy the result as a comma-separated list with one click.
사용 방법
- 1 Select a sequence type from the dropdown (Arithmetic, Geometric, Fibonacci, etc.).
- 2 Enter the starting value, step or ratio, and number of terms to generate.
- 3 For Custom sequences, type a formula using 'n' as the term index.
- 4 Click 'Generate' to compute the sequence.
- 5 View the sum, average, min, and max below the sequence.
- 6 Click 'Copy CSV' to copy the values as a comma-separated list.
Six classic sequences plus your own formula
A number sequence is an ordered list of numbers that follows a rule. This generator produces up to 100 terms of six named sequence types — arithmetic, geometric, Fibonacci, triangular, square, and prime — or lets you type any custom formula. For each result it also reports the sum, average, minimum, and maximum, and shows the underlying formula so you can see exactly how the terms were built. Understanding the rule behind each type is what makes the tool useful rather than magic.
How each built-in sequence is generated
| Type | Rule | First few terms (defaults) |
|---|---|---|
| Arithmetic | add a constant step each time: a(n) = start + (n−1)×step | 1, 2, 3, 4, 5… |
| Geometric | multiply by a constant ratio: a(n) = start × ratio^(n−1) | 1, 2, 4, 8, 16… |
| Fibonacci | each term is the sum of the two before it, starting 0, 1 | 0, 1, 1, 2, 3, 5, 8… |
| Triangular | T(n) = n(n+1)/2 — dots that form a triangle | 1, 3, 6, 10, 15… |
| Square | a(n) = n² — perfect squares | 1, 4, 9, 16, 25… |
| Prime | numbers divisible only by 1 and themselves | 2, 3, 5, 7, 11, 13… |
Arithmetic and geometric sequences expose Start and Step/Ratio inputs, so you can begin anywhere. The other named types have their starting point fixed by their mathematical definition — there is no "Fibonacci starting at 7" in the standard sense.
A worked example: geometric growth
Set the type to Geometric with Start = 3, Ratio = 2, and Count = 6. The tool computes 3 × 2⁰, 3 × 2¹, … up to 3 × 2⁵, giving 3, 6, 12, 24, 48, 96. The formula line shows a(n) = 3 × 2^(n-1), and the stats panel reports a sum of 189, an average of 31.5, a minimum of 3, and a maximum of 96. Change the ratio to 0.5 and the same machinery produces a shrinking sequence — geometric sequences model both exponential growth and decay depending on whether the ratio is above or below 1.
How primes are found
The prime option uses trial division: starting from 2, it tests each candidate by checking whether any odd number up to its square root divides it evenly. If none does, the candidate is prime. Checking only up to the square root is the key efficiency — if a number had a factor larger than its square root, it would also have a matching factor smaller than it, so there is no need to look further. The tool collects primes this way until it has the count you asked for.
Writing your own formula
Custom mode lets you enter a JavaScript-style expression using n as the 1-based term index. The expression is evaluated for n = 1, 2, 3, and so on. Some practical examples:
n * n→ squares (1, 4, 9, 16…)2 ** n→ powers of two (2, 4, 8, 16…)Math.pow(n, 3)→ cubes (1, 8, 27, 64…)n * (n + 1)→ pronic numbers (2, 6, 12, 20…)Math.round(100 * Math.sin(n))→ a wavy integer pattern
You have the full JavaScript Math library available. If your formula ever returns something that is not a finite number — say a division by zero, or a non-numeric result — the tool stops and reports the term index where it failed, rather than filling the list with NaN or Infinity.
Use cases
- Teaching and homework: generate worked sequences to study patterns, sums, and growth rates.
- Test data: produce predictable number lists to seed spreadsheets, charts, or unit tests via the Copy CSV button.
- Exploring math: compare how triangular, square, and Fibonacci numbers grow side by side.
- Programming practice: check your own sequence code against a known-correct reference.
Common mistakes
- Floating-point dust in geometric/custom results. Repeated multiplication can produce values like 0.30000000000000004; the tool rounds to about nine decimals to hide this noise, but very large geometric terms can still exceed the precise integer range and lose accuracy.
- Using the wrong index base. Custom formulas treat
nas starting at 1, not 0.n * ngives 1, 4, 9 — not 0, 1, 4. - Setting the geometric ratio to 0. That collapses every term to zero, so the tool rejects it.
- Expecting more than 100 terms. The count is capped at 100; ask for more and it is clamped.
All generation runs locally in your browser — nothing you enter is sent to a server.