{
  "id": "arithmetic-sequence",
  "version": "61d63c1cf6c0",
  "status": "published",
  "name": "Arithmetic Sequence Calculator",
  "question": "What is my arithmetic sequence?",
  "summary": "Finds the nth term and the sum of the first n terms of an arithmetic sequence from its first term and common difference, with the first terms and the explicit and recursive formulas.",
  "category": "math",
  "subcategory": "algebra",
  "url": "https://www.acalculator.org/math/arithmetic-sequence-calculator",
  "markdown": "https://www.acalculator.org/math/arithmetic-sequence-calculator.md",
  "kind": "function",
  "method": "aₙ = a₁ + (n − 1)d; Sₙ = n(a₁ + aₙ)/2.",
  "assumptions": [
    "Terms are numbered from 1; the first term is a₁.",
    "The numbers are read as the exact decimals typed and the formulas are worked out in exact fractions; each result is then the nearest 64-bit float.",
    "A term or sum beyond about 1.8 × 10^308 has no answer."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "a": {
        "title": "First term (a₁)",
        "description": "The first term of the sequence.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "d": {
        "title": "Common difference (d)",
        "description": "What is added to each term to get the next one.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "n": {
        "title": "Term number (n)",
        "description": "Which term to find, and how many terms to add up, from 1 to 10,000.",
        "type": "integer",
        "minimum": 1,
        "maximum": 10000
      }
    }
  },
  "outputs": {
    "nth": {
      "label": "nth term (aₙ)",
      "description": "The value of term number n.",
      "format": "number"
    },
    "sum": {
      "label": "Sum of the first n terms (Sₙ)",
      "description": "a₁ + a₂ + … + aₙ.",
      "format": "number"
    },
    "terms": {
      "label": "First terms",
      "description": "The first terms of the sequence, up to 10 of them.",
      "format": "text"
    },
    "explicit": {
      "label": "Explicit formula",
      "description": "A formula for term number n on its own.",
      "format": "text"
    },
    "recursive": {
      "label": "Recursive formula",
      "description": "The first term, and how each term follows from the one before.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "a": 2,
      "d": 3,
      "n": 10
    },
    "outputs": {
      "nth": 29,
      "sum": 155,
      "terms": "2, 5, 8, 11, 14, 17, 20, 23, 26, 29",
      "explicit": "a_n = 2 + 3(n - 1)",
      "recursive": "a_1 = 2, a_n = a_(n - 1) + 3"
    },
    "text": "Term 10 is 29, and the sum of terms 1 to 10 is 155."
  },
  "examples": [
    {
      "given": {
        "a": 2,
        "d": 10,
        "n": 5
      },
      "expect": {
        "nth": 42,
        "sum": 110,
        "terms": "2, 12, 22, 32, 42",
        "explicit": "a_n = 2 + 10(n - 1)"
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, section 13.2 Arithmetic Sequences (aₙ = a₁ + d(n − 1)), https://openstax.org/books/algebra-and-trigonometry-2e/pages/13-2-arithmetic-sequences, retrieved 2026-10-02, example: 2, 12, 22, 32, 42 has aₙ = 2 + 10(n − 1) and a₅ = 42; hand calculation in content.mdx: S₅ = 5 × (2 + 42)/2 = 110"
    },
    {
      "given": {
        "a": 5,
        "d": 3,
        "n": 10
      },
      "expect": {
        "nth": 32,
        "sum": 185,
        "recursive": "a_1 = 5, a_n = a_(n - 1) + 3"
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, section 13.4 Series and Their Notations (Sₙ = n(a₁ + aₙ)/2), https://openstax.org/books/algebra-and-trigonometry-2e/pages/13-4-series-and-their-notations, retrieved 2026-10-02, example: 5 + 8 + … + 32 = 185"
    },
    {
      "given": {
        "a": 8,
        "d": 2,
        "n": 5
      },
      "expect": {
        "nth": 16,
        "sum": 60
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, section 13.2 Arithmetic Sequences (aₙ = a₁ + d(n − 1)), https://openstax.org/books/algebra-and-trigonometry-2e/pages/13-2-arithmetic-sequences, retrieved 2026-10-02, example: a₁ = 8, d = 2 gives a₅ = 16; hand calculation in content.mdx: S₅ = 5 × (8 + 16)/2 = 60"
    },
    {
      "given": {
        "a": 10,
        "d": -4,
        "n": 6
      },
      "expect": {
        "nth": -10,
        "sum": 0,
        "explicit": "a_n = 10 - 4(n - 1)",
        "terms": "10, 6, 2, -2, -6, -10"
      },
      "source": "hand calculation in content.mdx: 10, 6, 2, −2, −6, −10 add up to 0"
    },
    {
      "given": {
        "a": 0.1,
        "d": 0.2,
        "n": 3
      },
      "expect": {
        "nth": 0.5,
        "sum": 0.9,
        "terms": "0.1, 0.3, 0.5"
      },
      "source": "hand calculation in content.mdx: 0.1 + 0.3 + 0.5 = 0.9 in exact decimals"
    }
  ],
  "sources": [
    "OpenStax, Algebra and Trigonometry 2e, section 13.2 Arithmetic Sequences (aₙ = a₁ + d(n − 1); examples 2, 12, 22, … and a₁ = 8, a₄ = 14), CC BY 4.0, retrieved 2026-10-02. https://openstax.org/books/algebra-and-trigonometry-2e/pages/13-2-arithmetic-sequences",
    "OpenStax, Algebra and Trigonometry 2e, section 13.4 Series and Their Notations (Sₙ = n(a₁ + aₙ)/2; example 5 + 8 + … + 32 = 185), CC BY 4.0, retrieved 2026-10-02. https://openstax.org/books/algebra-and-trigonometry-2e/pages/13-4-series-and-their-notations"
  ],
  "related": [
    "sequence",
    "geometric-sequence",
    "summation"
  ],
  "changelog": []
}
