# Sequence calculator > How do you find the nth term and the sum of a sequence? The nth term and the sum of an arithmetic or geometric sequence, drawn term by term. Find the nth term and the sum of the first n terms of an arithmetic or geometric sequence, with the infinite sum when it converges and the terms drawn live. - Page: https://how.box/sequence/ - Runs entirely in the browser. - License: HowToolbox's own text and data (titles, explanations, FAQs, tool descriptions and schemas, this file) are CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/); AI training and answers are welcome. Attribute "HowToolbox (how.box)" with a link to the page used. Third-party data keeps its own terms; the name and logo are not licensed. Publisher: HowToolbox, contact@how.box. Terms: https://how.box/about/terms/ ## Inputs Answer link: https://how.box/sequence/?k={k}&a={a}&d={d}&r={r}&n={n} - `k` (arithmetic or geometric): arithmetic (default) or geometric. Example: `arithmetic`. - `a` (number -1e9 to 1e9): The first term a₁. Example: `2`. - `d` (number -1e9 to 1e9): The common difference (k arithmetic). Example: `3`. - `r` (number -1e9 to 1e9): The common ratio (k geometric). Example: `0.5`. - `n` (whole number 1 to 10000): Which term and how many to sum. Example: `10`. Example answer: https://how.box/sequence/?k=arithmetic&a=2&d=3&r=0.5&n=10 A complete link carries the primary answer in the page HTML; a missing or invalid value shows the default page. ## Agent tools - `sequence_calculate`: Arithmetic or geometric sequence. - MCP, one POST to https://how.box/mcp: `{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"sequence_calculate","arguments":{"kind":"arithmetic","first":2,"difference":3,"ratio":0.5,"n":10}}}` - GET: https://how.box/mcp/run/sequence_calculate?kind=arithmetic&first=2&difference=3&ratio=0.5&n=10 ## How it works A sequence is a list of numbers that follows a rule. In an arithmetic sequence you add the same difference d each time (2, 5, 8, 11, …, d = 3); in a geometric one you multiply by the same ratio r (2, 1, 0.5, 0.25, …, r = 0.5). The rule lets you jump straight to any term without writing out the ones before it. The nth term is aₙ = a₁ + (n − 1)d for an arithmetic sequence and aₙ = a₁ · rⁿ⁻¹ for a geometric one. The sum of the first n terms is Sₙ = n(a₁ + aₙ)/2, the average of the first and last term times their number, or Sₙ = a₁(1 − rⁿ)/(1 − r) for a geometric sequence. For 2, 5, 8, …: a₁₀ = 2 + 9 × 3 = 29 and S₁₀ = 10 × (2 + 29)/2 = 155. When −1 < r < 1 the terms of a geometric sequence shrink so fast that adding all of them, forever, gives a finite number: S∞ = a₁/(1 − r), 4 for 2, 1, 0.5, … Results are rounded to six significant digits, and the drawing shows up to 30 terms. Source: OpenStax College Algebra 2e, sections 9.2 to 9.4. ## FAQ **Does n start at zero or one?** The first term is a₁, so enter n = 1 to return it. The sum includes that first term through the nth term. **Can I use a negative common difference?** Yes. An arithmetic sequence decreases when its common difference is negative. **What does a negative geometric ratio do?** It alternates the signs of successive nonzero terms. The size grows or shrinks according to the ratio’s absolute value. **Why are only 30 terms drawn when I ask for more?** The drawing is limited to the first 30 terms for readability. The nth term and total still use the n you entered. **Can this find the rule from a list of numbers?** No. You must choose arithmetic or geometric and supply the first term and difference or ratio; it does not infer a pattern or calculate Fibonacci sequences. More: [HowToolbox index](https://how.box/llms.txt) · [Agent Skill](https://how.box/skill.md) · [agent terms](https://how.box/about/agents/)