User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
Number Sequence Generator
Choose a sequence family to configure its parameters.
Max 50,000. Collatz ignores this (stops at 1).
Is this tool helpful?

Your feedback helps us improve.

โ˜… โ˜… โ˜… โ˜… โ˜…

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.

number sequence generator arithmetic sequence geometric sequence fibonacci generator prime number generator triangular numbers collatz sequence factorial sequence catalan numbers custom recurrence

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 -

{
n รท 2 if n is even3n + 1 if n is odd

Unproven conjecture: every positive integer eventually reaches 1. Verified for all n < 268.

Reference Data

SequenceFormula / RuleFirst 8 TermsOEIS ID
Arithmetic (d=3)a(n) = a1 + (nโˆ’1)d1, 4, 7, 10, 13, 16, 19, 22 -
Geometric (r=2)a(n) = a1 โ‹… rnโˆ’11, 2, 4, 8, 16, 32, 64, 128A000079
FibonacciF(n) = F(nโˆ’1) + F(nโˆ’2)0, 1, 1, 2, 3, 5, 8, 13A000045
PrimesTrial division / Sieve2, 3, 5, 7, 11, 13, 17, 19A000040
TriangularT(n) = n(n+1)21, 3, 6, 10, 15, 21, 28, 36A000217
Square NumbersS(n) = n21, 4, 9, 16, 25, 36, 49, 64A000290
Cube NumbersC(n) = n31, 8, 27, 64, 125, 216, 343, 512A000578
Powers of 22n1, 2, 4, 8, 16, 32, 64, 128A000079
Factorialn! = nโˆk=1 k1, 1, 2, 6, 24, 120, 720, 5040A000142
CatalanCn = 1n+1C(2n, n)1, 1, 2, 5, 14, 42, 132, 429A000108
Collatz (start 6)n โ†’ nรท2 or 3n+16, 3, 10, 5, 16, 8, 4, 2 -
LucasL(n) = L(nโˆ’1) + L(nโˆ’2)2, 1, 3, 4, 7, 11, 18, 29A000032
PentagonalP(n) = n(3nโˆ’1)21, 5, 12, 22, 35, 51, 70, 92A000326
HexagonalH(n) = n(2nโˆ’1)1, 6, 15, 28, 45, 66, 91, 120A000384
PellP(n) = 2P(nโˆ’1) + P(nโˆ’2)0, 1, 2, 5, 12, 29, 70, 169A000129

Frequently Asked Questions

The generator uses JavaScript BigInt for factorial and Catalan computations. Standard IEEE 754 doubles lose precision beyond 2^53 โˆ’ 1 (approximately 9 ร— 10^15). Factorial of 21 already exceeds this. BigInt provides arbitrary-precision integers, so factorial of 1000 (a number with 2,568 digits) is computed exactly. The output is rendered as a string to preserve all digits.
The tool caps output at 50,000 terms. Arithmetic, geometric, square, cube, triangular, and power sequences generate in under 50ms for 50,000 terms. Prime generation via sieve handles up to approximately 10^7 efficiently; beyond that, trial division slows to roughly O(nโˆšn). Fibonacci and custom recurrences with BigInt seeds slow proportionally to digit count. A progress indicator appears for any generation exceeding 200ms.
Yes. The parser does not use eval() or Function(). It tokenizes the input into a whitelist of allowed tokens: numeric literals, the variables a(n-1), a(n-2), n, and operators +, โˆ’, ร—, รท, ^, along with parentheses. Any unrecognized token aborts parsing with an error message. This prevents arbitrary code execution entirely.
The Collatz sequence terminates when it reaches 1 (the conjectured fixed point). Its length is unpredictable - starting from 27 produces 111 steps, while 26 produces only 10. The generator runs until reaching 1 or hitting the 50,000-term safety limit. You can also set a custom maximum term count to truncate early.
For generating the first N primes where the estimated upper bound is below 10,000,000, the tool uses the Sieve of Eratosthenes with an upper bound estimated via the prime number theorem: p(n) โ‰ˆ n ร— (ln(n) + ln(ln(n))). For larger requests, it falls back to incremental trial division testing each candidate against known primes up to its square root. The sieve approach runs in O(n log log n) time and is preferred.
Yes. The Fibonacci-type sequence allows custom seeds for the first two terms. Setting seedโ‚ = 2 and seedโ‚‚ = 1 produces the Lucas sequence (2, 1, 3, 4, 7, 11, 18, ...). Setting seedโ‚ = 2 and seedโ‚‚ = 6 produces the Pell-related sequence. Any pair of integers (including negatives) is accepted.