Number Sequence Generator - Arithmetic, Geometric, Fibonacci, Primes & More
Generate number sequences: arithmetic, geometric, Fibonacci, primes, triangular, Collatz, factorial, Catalan, and custom recurrences. Copy or download results.
About
Errors in sequence generation cascade. A miscalculated common difference in an arithmetic progression corrupts every subsequent term. A wrong ratio in a geometric series compounds exponentially. This generator implements exact integer arithmetic using BigInt where overflow threatens precision - particularly for factorial (n!) and Catalan numbers (Cn). It covers 12 sequence families: arithmetic, geometric, Fibonacci-type, primes (via Sieve of Eratosthenes up to bounded limits), triangular, square, cube, powers, Collatz, Catalan, factorial, and user-defined recurrences parsed without eval(). The tool approximates nothing - every term is computed from its defining formula or recurrence relation.
Limitation: custom recurrence expressions support basic arithmetic operators (+, โ, ร, รท, ^) and references to a(nโ1), a(nโ2), and n. Transcendental functions are not included. Prime generation uses trial division beyond sieve range, which slows above 107. Pro tip: for Collatz sequences, starting values above 109 may produce thousands of terms before reaching 1 - set a term limit to avoid excessive output.
Formulas
Arithmetic Sequence - a(n) = a1 + (n โ 1) โ d
where a1 is the first term, d is the common difference, n is the term index.
Geometric Sequence - a(n) = a1 โ rn โ 1
where r is the common ratio. Diverges when |r| โฅ 1.
Fibonacci Recurrence - F(n) = F(n โ 1) + F(n โ 2)
with seeds F(0) = 0, F(1) = 1. Custom seeds produce generalized Fibonacci (tribonacci, Lucas, etc.).
Triangular Numbers - T(n) = n(n + 1)2
where n โฅ 1.
Catalan Numbers - Cn = 1n + 1 (2n)!n! โ n!
Computed via BigInt to avoid overflow. Counts structurally distinct full binary trees with n + 1 leaves.
Collatz Conjecture -
Unproven conjecture: every positive integer eventually reaches 1. Verified for all n < 268.
Reference Data
| Sequence | Formula / Rule | First 8 Terms | OEIS ID |
|---|---|---|---|
| Arithmetic (d=3) | a(n) = a1 + (nโ1)d | 1, 4, 7, 10, 13, 16, 19, 22 | - |
| Geometric (r=2) | a(n) = a1 โ rnโ1 | 1, 2, 4, 8, 16, 32, 64, 128 | A000079 |
| Fibonacci | F(n) = F(nโ1) + F(nโ2) | 0, 1, 1, 2, 3, 5, 8, 13 | A000045 |
| Primes | Trial division / Sieve | 2, 3, 5, 7, 11, 13, 17, 19 | A000040 |
| Triangular | T(n) = n(n+1)2 | 1, 3, 6, 10, 15, 21, 28, 36 | A000217 |
| Square Numbers | S(n) = n2 | 1, 4, 9, 16, 25, 36, 49, 64 | A000290 |
| Cube Numbers | C(n) = n3 | 1, 8, 27, 64, 125, 216, 343, 512 | A000578 |
| Powers of 2 | 2n | 1, 2, 4, 8, 16, 32, 64, 128 | A000079 |
| Factorial | n! = nโk=1 k | 1, 1, 2, 6, 24, 120, 720, 5040 | A000142 |
| Catalan | Cn = 1n+1C(2n, n) | 1, 1, 2, 5, 14, 42, 132, 429 | A000108 |
| Collatz (start 6) | n โ nรท2 or 3n+1 | 6, 3, 10, 5, 16, 8, 4, 2 | - |
| Lucas | L(n) = L(nโ1) + L(nโ2) | 2, 1, 3, 4, 7, 11, 18, 29 | A000032 |
| Pentagonal | P(n) = n(3nโ1)2 | 1, 5, 12, 22, 35, 51, 70, 92 | A000326 |
| Hexagonal | H(n) = n(2nโ1) | 1, 6, 15, 28, 45, 66, 91, 120 | A000384 |
| Pell | P(n) = 2P(nโ1) + P(nโ2) | 0, 1, 2, 5, 12, 29, 70, 169 | A000129 |