Number Sequence Generator
ΝέοGenerate arithmetic and geometric sequences, Fibonacci, primes and custom formulas.
+ − * / ^ sqrt abs floor ceil round sin cos log. Examples: n^2, n*(n+1)/2, 2^n Runs entirely in your browser. Nothing is uploaded.
What is a number sequence calculator?
A number sequence calculator is an online tool that generates and analyzes ordered lists of numbers following a specific mathematical pattern. The most common sequence types are arithmetic (constant difference), geometric (constant ratio), and Fibonacci (each term is the sum of the two previous), but sequences also include prime numbers, perfect squares, triangular numbers, and any pattern expressible as a formula in terms of the index n. Students, mathematicians, and programmers use sequence calculators to generate reference lists, verify formulas, and explore number patterns.
Our free number sequence calculator supports six sequence types: Arithmetic (enter first term and common difference), Geometric (enter first term and common ratio), Fibonacci (customizable seed values), Primes (first N primes or all primes in a range using the Sieve of Eratosthenes), Custom Formula (any expression in n with math functions), and Squares & Cubes (n² and n³ side by side). Every generated sequence shows the nth-term formula, partial sum, and a copy-to-clipboard button.
How to use the number sequence generator
Select your sequence type from the tab bar at the top. For Arithmetic sequences, enter the first term (a₁), common difference (d), and number of terms (n), then click Generate. The calculator displays the full sequence, the nth-term formula aₙ = a₁ + (n−1)d, the last term aₙ, and the partial sum Sₙ = n/2 × (a₁ + aₙ). For Geometric sequences, enter first term (a₁), common ratio (r), and n; the sum Sₙ = a₁(1−rⁿ)/(1−r) is displayed along with whether the infinite series would converge. For Custom Formula, type any expression using n (e.g., n^2+2*n+1) and set the starting index and term count. Click the Copy sequence button on any result card to copy the comma-separated values to your clipboard.
Why use this calculator instead of WolframAlpha or RapidTables?
Most number sequence tools cover only arithmetic and geometric sequences. WolframAlpha can solve sequences but requires a Pro subscription ($7.99/month) to see full step-by-step solutions, sends every query to Wolfram's servers, and doesn't offer a dedicated generator for Fibonacci variants, primes or custom formulas. rapidtables.com has simple arithmetic and geometric calculators but nothing for Fibonacci sequences, prime generation or custom formula evaluation.
This calculator adds Fibonacci with custom seeds (explore Lucas numbers and other Fibonacci variants), a prime number sieve supporting up to 500 primes or ranges up to 1,000,000, a custom formula evaluator with a safe restricted math parser (no code injection possible), and a dedicated Squares & Cubes tab for quick reference tables. The copy-to-clipboard feature on every output card makes it easy to pipe results into spreadsheets or Python without manual transcription. All computation runs locally in your browser — instant results, no server round-trip, no sign-up required.
Sequence formulas and real-world applications
Arithmetic sequences model linear growth: constant-rate savings, straight-line depreciation, equally-spaced measurement readings. The sum formula Sₙ = n/2 × (2a₁ + (n−1)d) is especially useful in finance and physics problems. Geometric sequences model exponential processes: compound interest (future value = P × r^n), radioactive decay (amount = A₀ × (1/2)^(t/half-life)), and population growth. The infinite sum S∞ = a₁/(1−r) for |r| < 1 underlies present-value calculations of annuities and perpetuities.
Fibonacci sequences appear in nature (the number of spirals on a sunflower head is always a Fibonacci number), algorithm analysis (the time complexity of naive recursive Fibonacci is O(φⁿ)), and data structures (the Fibonacci heap). The ratio of consecutive terms converges to the golden ratio φ ≈ 1.618 regardless of the starting seeds. Prime sequences are fundamental to cryptography: RSA encryption relies on the difficulty of factoring large numbers into primes. The prime-finding sieve runs in O(n log log n) time and can generate all primes up to 1,000,000 in milliseconds in your browser.
Works on any device, no download or account needed
This free number sequence calculator online runs entirely in your browser — on iPhone, Android, iPad, tablet or desktop — with no app to install and no account to create. Every calculation happens locally, so your inputs are never sent to a server. Results appear instantly as you type, and the copy-to-clipboard button on each result makes it easy to move sequences into spreadsheets, Python scripts or exam answers. There's no sign-up, no paywall and no usage limit.
Arithmetic sequences: the Gauss trick, nth-term and sum formulas
An arithmetic sequence is any ordered list of numbers where each term differs from the previous by a fixed constant called the common difference d. The general term is given by the nth-term formula aₙ = a₁ + (n−1)d, where a₁ is the first term. This formula lets you jump directly to any term in the list — for example, in the sequence 7, 11, 15, 19 (a₁ = 7, d = 4), the 50th term is 7 + (49 × 4) = 203 without listing all the preceding terms.
The sum of the first n terms of an arithmetic sequence is Sₙ = n/2 × (a₁ + aₙ), equivalently written as n/2 × (2a₁ + (n−1)d). The formula was understood in antiquity, but the most famous illustration comes from Carl Friedrich Gauss. As a young pupil, reportedly around age 10, he was set the task of adding all integers from 1 to 100. Instead of summing each number in turn, Gauss noticed that pairing the first term with the last gives 1 + 100 = 101, the second with the second-to-last gives 2 + 99 = 101, and so on — producing 50 identical pairs. The total is therefore 50 × 101 = 5050, arrived at almost instantly. That paired-terms insight is encoded in the formula S = n/2 × (a₁ + aₙ), which is now a cornerstone of every secondary-school algebra curriculum.
Arithmetic sequences appear constantly in finance and engineering. Pay scales with regular annual increments are arithmetic: if a starting salary is $42,000 and increases by $2,500 per year, the salary after n years is simply a₁ + (n−1) × 2500. Straight-line depreciation is also arithmetic: a machine worth $80,000 depreciated by $8,000 per year loses value according to the sequence 80000, 72000, 64000… until it reaches its salvage value after n years. Any situation where a quantity changes by the same absolute amount in each period is, at its core, an arithmetic progression.
Geometric sequences: exponential growth, convergent series and Achilles
In a geometric sequence each term is obtained by multiplying the previous term by a fixed constant called the common ratio r. The nth-term formula is aₙ = a₁ × rⁿ⁻¹. When |r| > 1 terms grow without bound (exponential explosion); when 0 < |r| < 1 terms shrink toward zero; when r is negative terms alternate in sign. The sum of the first n terms is Sₙ = a₁(1 − rⁿ) / (1 − r) for r ≠ 1. When r = 1 every term is identical and Sₙ = n × a₁.
Perhaps the deepest result in the theory of geometric series is that an infinite geometric series converges whenever |r| < 1, with sum S∞ = a₁ / (1 − r). This resolves Zeno's ancient paradox of Achilles and the tortoise: if Achilles runs at 10 m/s and the tortoise starts 100 m ahead at 1 m/s, Achilles must first cover the 100 m gap, by which time the tortoise has moved 10 m further; then 1 m further, then 0.1 m further — an infinite number of steps. Zeno argued Achilles can never catch the tortoise. The resolution is that the infinite series 100 + 10 + 1 + 0.1 + … is a geometric series with a₁ = 100 and r = 0.1, so it sums to a finite value: S∞ = 100 / (1 − 0.1) ≈ 111.1 m — exactly the distance at which Achilles overtakes the tortoise.
Geometric sequences model every process driven by a constant percentage change. Compound interest is the canonical example: a principal P at annual rate r grows to P × (1 + r)ⁿ after n years — a geometric sequence with ratio (1 + r). Radioactive decay uses ratio r = ½ per half-life. Moore's Law — the empirical observation that the number of transistors on a chip doubles approximately every two years — is a geometric sequence with r = 2 on a two-year interval, producing the exponential curve that has driven semiconductor progress since the 1960s. Population growth in an environment with unlimited resources follows the same geometric pattern, though real populations eventually plateau as resources become constrained.
The Fibonacci sequence, the golden ratio and nature's packing algorithm
The Fibonacci sequence is defined by the recurrence F(n) = F(n−1) + F(n−2) with seeds F(1) = 1 and F(2) = 1, producing 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144… Each term is the sum of the two preceding terms. Leonardo of Pisa, known as Fibonacci, introduced the sequence in his 1202 treatise Liber Abaci as part of a rabbit breeding problem: starting with one pair of newborns, how many pairs exist after n months if each mature pair produces one new pair every month? The answer in month n is exactly F(n). Variants such as the Lucas numbers (seeds 2 and 1, giving 2, 1, 3, 4, 7, 11, 18…) satisfy the same recurrence and share many of Fibonacci's properties.
As n increases, the ratio F(n+1)/F(n) converges to the golden ratio φ = (1 + √5) / 2 ≈ 1.61803. This convergence is rapid: F(10)/F(9) = 55/34 ≈ 1.6176; by F(20)/F(19) the value matches φ to five decimal places. The golden ratio satisfies the remarkable identity φ² = φ + 1, making it geometrically self-similar — a rectangle with sides in ratio φ : 1 can be divided into a square and a smaller golden rectangle in the same proportion indefinitely. Binet's closed-form formula, Fₙ = (φⁿ − ψⁿ) / √5 where ψ = (1 − √5)/2, gives any Fibonacci number without computing previous terms.
The most striking appearance of Fibonacci in nature is in phyllotaxis — the arrangement of leaves, seeds and petals. A sunflower head contains two interlocking families of spirals; the counts are almost always consecutive Fibonacci numbers such as 34 and 55, or 55 and 89. Pine cone scales, pineapple facets and artichoke bracts show the same pattern. The reason is rooted in the phyllotaxis angle of 137.5°, which equals 360° / φ². Because φ is irrational, each successive primordium is placed at an angle that never exactly repeats modulo 360°, ensuring uniform distribution around the stem with no two primordia competing for the same radial slot. This is nature's optimal packing solution, arrived at by evolution and expressible entirely in terms of a simple integer recurrence.
Famous sequences in mathematics: primes, perfect numbers, Pascal's triangle and Collatz
The prime numbers (2, 3, 5, 7, 11, 13, 17, 19, 23, 29…) are integers greater than 1 with no divisors other than 1 and themselves. The Sieve of Eratosthenes, devised around 240 BCE, finds all primes up to n by iteratively marking the multiples of each prime starting from p² — any composite must have a factor ≤ √n, so stopping at √n suffices. The algorithm runs in O(n log log n) time and is still the practical standard for prime generation. The prime number theorem, proved independently by Hadamard and de la Vallée Poussin in 1896, states that the number of primes up to n is approximately π(n) ≈ n / ln(n): primes become progressively sparser, yet infinitely many exist (Euclid's proof by contradiction remains one of mathematics' most elegant). The primality of large numbers underpins RSA encryption, the protocol securing almost every HTTPS connection on the internet.
Perfect numbers are positive integers equal to the sum of all their proper divisors. The first two are 6 (= 1 + 2 + 3) and 28 (= 1 + 2 + 4 + 7 + 14). The next are 496 and 8128. Euclid showed that numbers of the form 2ᵖ⁻¹ × (2ᵖ − 1) are perfect whenever 2ᵖ − 1 is prime (a Mersenne prime). Whether any odd perfect number exists remains an open problem after more than 2,000 years. Triangular numbers, Tₙ = n(n+1)/2, count the dots in an equilateral triangle with n rows: 1, 3, 6, 10, 15, 21… They equal the binomial coefficient C(n+1, 2) and appear as the second diagonal of Pascal's triangle — the triangular array whose entries are binomial coefficients. Pascal's triangle also hides the Fibonacci numbers along its shallow diagonals, the powers of 11 in its rows, and connections to the binomial theorem, probability, and combinatorics.
The Collatz conjecture is one of mathematics' most deceptively simple unsolved problems. Take any positive integer n: if n is even, divide it by 2; if n is odd, multiply by 3 and add 1. Repeat. For every starting value ever tested — billions of cases checked by computer — the sequence eventually reaches 1 (then cycles 1 → 4 → 2 → 1 forever), yet no one has proved this must always happen. Starting from 27, the sequence reaches a peak of 9,232 after 77 steps before finally descending to 1 after 111 steps — a dramatic illustration of how unpredictable even the simplest integer rules can be. The Collatz sequence, prime numbers, perfect numbers and Pascal's triangle all demonstrate that number sequences are not merely calculation exercises — they are gateways to some of mathematics' deepest open questions and most useful applied results.
Frequently asked questions
What is the difference between arithmetic and geometric sequences?
In an arithmetic sequence, consecutive terms differ by a constant called the common difference (d): each term is the previous one plus d. In a geometric sequence, consecutive terms have a constant ratio (r): each term is the previous one multiplied by r. For example, 2, 5, 8, 11 is arithmetic (d = 3), while 2, 6, 18, 54 is geometric (r = 3). Arithmetic sequences grow linearly and plot as a straight line; geometric sequences grow exponentially and plot as a curve. Both types are fundamental in algebra, finance and statistics courses.
What is the formula for the nth term of an arithmetic sequence?
The nth term of an arithmetic sequence is aₙ = a₁ + (n − 1) × d, where a₁ is the first term and d is the common difference. For example, in the sequence 3, 7, 11, 15 (a₁ = 3, d = 4), the 10th term is 3 + (10 − 1) × 4 = 39. This formula lets you jump directly to any term without listing all preceding ones — essential for large values of n. This calculator shows the formula evaluated for your specific inputs alongside the full term list.
What is the sum of an arithmetic sequence?
The sum of the first n terms of an arithmetic sequence is Sₙ = n/2 × (a₁ + aₙ) = n/2 × (2a₁ + (n − 1)d). This comes from pairing the first and last terms — each pair sums to (a₁ + aₙ), and there are n/2 such pairs. Gauss famously used this at age 10 to sum all integers from 1 to 100: S = 100/2 × (1 + 100) = 5050. WolframAlpha can compute this too, but requires typing the closed-form query manually and sends your data to Wolfram's servers. Here you just enter a₁, d and n.
What is the formula for the nth term of a geometric sequence?
The nth term of a geometric sequence is aₙ = a₁ × r^(n − 1), where a₁ is the first term and r is the common ratio. For example, in the sequence 5, 10, 20, 40 (a₁ = 5, r = 2), the 8th term is 5 × 2^7 = 640. When |r| > 1 terms grow without bound; when 0 < |r| < 1 they shrink toward zero; when r is negative terms alternate in sign. The calculator shows this formula and evaluates it for the number of terms you specify.
How do I find the sum of a geometric series?
For a finite geometric series with first term a₁ and ratio r ≠ 1, the sum of the first n terms is Sₙ = a₁ × (1 − rⁿ) / (1 − r). When r = 1, all terms are equal and Sₙ = n × a₁. For an infinite geometric series, if |r| < 1 the series converges to S∞ = a₁ / (1 − r); if |r| ≥ 1 the series diverges. Compound interest calculations and present-value perpetuity formulas are direct applications of the infinite sum formula. This calculator computes both the finite partial sum and tells you whether the infinite series converges.
What is the Fibonacci sequence?
The Fibonacci sequence is defined by F₁ = 1, F₂ = 1, and Fₙ = Fₙ₋₁ + Fₙ₋₂ for n > 2, giving: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89. Each term is the sum of the two preceding terms. The sequence appears in nature (sunflower seed spirals, pine cone bracts, nautilus shell growth), art (the golden rectangle), and computer science (Fibonacci heap data structures). This generator also lets you change the starting seeds to explore generalized Fibonacci-type sequences like the Lucas numbers (2, 1, 3, 4, 7, 11…).
What is the golden ratio and how does it relate to Fibonacci?
The golden ratio φ = (1 + √5) / 2 ≈ 1.61803. As the Fibonacci sequence grows, the ratio of consecutive terms Fₙ₊₁/Fₙ converges rapidly toward φ: F₁₀/F₉ = 55/34 ≈ 1.6176, F₂₀/F₁₉ ≈ 1.61803. This convergence means Fibonacci spirals and the golden spiral appear nearly identical. The golden ratio also satisfies φ² = φ + 1, making it self-similar. The Fibonacci tab in this calculator shows the current term ratio converging toward φ as n increases, which is a useful illustration for courses on number theory.
How does the Sieve of Eratosthenes work?
Start with a boolean array marking all integers from 2 to n as prime. For the first unmarked prime p = 2, mark all its multiples (4, 6, 8…) as composite, starting from p². Move to the next unmarked number and repeat. Stop when p² > n — all remaining unmarked numbers are prime. This runs in O(n log log n) time, making it the most efficient method for finding all primes up to a given limit. This calculator uses this algorithm to generate up to 500 primes instantly in your browser, with no server request required.
What are triangular numbers?
The nth triangular number is Tₙ = n(n+1)/2, representing the number of dots in an equilateral triangle arrangement with n rows. The sequence is 1, 3, 6, 10, 15, 21, 28, 36. Triangular numbers appear in combinatorics (Tₙ = C(n+1, 2), the number of ways to choose 2 items from n+1), and as the third diagonal of Pascal's triangle. Use the Custom Formula tab with expression n*(n+1)/2 to generate triangular numbers for any range you choose.
Can I define custom sequences using my own formula?
Yes. In the Custom Formula tab, enter any mathematical expression using n as the variable (where n starts from your chosen start value). Supported operators and functions include +, −, *, /, ^ (power), sqrt, abs, floor, ceil, round, sin, cos, and log. For example: n^2 generates perfect squares, n*(n+1)/2 generates triangular numbers, 2^n generates powers of two, and floor(sqrt(n)) generates integer square roots. The expression is safely evaluated using a restricted math parser — no code injection is possible. This is a feature most dedicated sequence calculators, including those on rapidtables.com, don't offer.
How do I find a missing term in a number sequence?
First identify whether the sequence is arithmetic (constant difference), geometric (constant ratio), or another type such as Fibonacci or quadratic. For arithmetic: compute the difference between any two consecutive terms — that is d. For geometric: compute the ratio of any term to the previous one — that is r. Then apply the relevant nth-term formula to find the missing position. If neither difference nor ratio is constant, check second differences (quadratic sequences have constant second differences) or try the custom formula feature with expressions like n^2 or n^2+n.
What is the difference between a sequence and a series?
A sequence is an ordered list of numbers (the individual terms): 2, 4, 6, 8, 10. A series is the sum of the terms of a sequence: 2 + 4 + 6 + 8 + 10 = 30 (the partial sum for the first 5 terms). This calculator computes both: the sequence (the full list of terms displayed) and the partial sum (the series value Sₙ) for the number of terms you specify. The distinction matters in calculus and analysis, where a sequence can diverge while its partial sums might converge under certain conditions.
What are perfect squares and perfect cubes?
Perfect squares are integers that are the square of another integer: 1, 4, 9, 16, 25, 36, 49, 64, 81, 100 (n² for n = 1, 2, 3…). Perfect cubes are integers that are the cube of another integer: 1, 8, 27, 64, 125, 216 (n³ for n = 1, 2, 3…). These sequences are fundamental in number theory, algebra and geometry (area vs. volume scaling). Use the Squares & Cubes tab to generate both sequences side by side for any range up to n = 100.
How do I copy the generated sequence for use elsewhere?
Each generated sequence card includes a 'Copy sequence' button at the bottom. Clicking it copies the comma-separated list of numbers to your clipboard instantly, with the button briefly showing 'Copied!' as confirmation. You can then paste the sequence directly into a spreadsheet (Excel, Google Sheets), a calculator app, a Python list, or any other tool. The copy includes all generated terms in order, formatted as comma-separated values — no manual transcription needed.
Does this calculator work on iPhone and Android without an app?
Yes. This is a fully responsive web app that works on any modern smartphone browser — Safari on iPhone, Chrome on Android, Firefox on any device. No app download, no Play Store or App Store search required. All sequence calculations run in your browser using JavaScript, so results are instant and nothing is sent to a server. On mobile, the interface adapts to smaller screens with a tab bar at the top and scrollable term lists below each result.
Related tools
Προβολή όλων των εργαλείωνΜεταφραστής Κώδικα Morse
Μεταφράστε κείμενο σε κώδικα Morse και αντίστροφα, με αναπαραγωγή ήχου.
Υπολογιστής Αναλογίας Διαστάσεων
Κλειδώστε μια αναλογία και βρείτε το πλάτος ή ύψος που λείπει για νέο μέγεθος.
Αριθμός σε Λέξεις
Γράψτε κάθε αριθμό ολογράφως στα αγγλικά, με λειτουργία νομίσματος για επιταγές.
Υπολογιστής Διάρκειας Χρόνου
Βρείτε τον χρόνο μεταξύ δύο ωρών και αθροίστε πολλαπλές διάρκειες.
Μετατροπέας ζώνης ώρας
Συγκρίνετε την ώρα σε διάφορες πόλεις και προγραμματίστε συναντήσεις που βολεύουν όλους.
Currency Converter
Convert between 30+ world currencies with recent reference rates — fully in your browser.