Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

Arithmetic Sequence Calculator (nth Term and Sum)

Enter the first term (the first number of the sequence), the common difference (how much each term goes up) and the number of terms (how far to go), then press "Calculate". You get the first few terms, the nth term and the sum of the first n terms at once. The formula below is linked to the input fields, so you can also edit the first term, common difference and number of terms right inside the formula.

The first term and the common difference can be decimals or negative numbers. Enter the number of terms n as a positive whole number (1 to 100000).
Result and graph
Enter the first term, the common difference and the number of terms in the fields on the left and press "Calculate". The result and a graph will appear here.

What you can do on this page

  • Enter just three values, the first term, the common difference (how much each term goes up) and the number of terms, to get the \(n\)th term and the sum of the first \(n\) terms at once
  • Works directly for problems like "The sequence 2, 7, 12, 17, … goes up by 5 each time. What is the 20th number? What do the first 20 numbers add up to?"
  • The first term and the common difference can be decimals or negative numbers (for a decreasing sequence, make the common difference negative)
  • Along with the result, a graph shows how the terms line up on a straight line (the common difference is how fast they rise)
  • A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
This page works only for arithmetic sequences (sequences where the difference between neighboring terms is always the same). It does not work for sequences that grow by multiplying by the same number, such as 2, 6, 18, … (geometric sequences).

What is this calculation used for?

Estimate the total of a growing savings plan (money planning)

A savings plan of "save $50 the first month, then $25 more each month" is an arithmetic sequence with first term 50 and common difference 25. In month 12 you save \(50 + 11 \times 25 = 325\) dollars, and the total for the year is \(12 \times (50 + 325) \div 2 = 2250\) dollars. Two formulas let you see far ahead.
Any plan that goes up (or down) by the same amount each time, and the questions "How much is it the kth time?" and "What is the total?", are arithmetic sequence calculations.

Count the seats in a theater or stadium (design and event planning)

Halls with seats that fan out often have rows like "20 seats in row 1, and 2 more seats in each row behind it". With 30 rows, the last row has \(20 + 29 \times 2 = 78\) seats, and the whole hall has \(30 \times (20 + 78) \div 2 = 1470\) seats.
Without counting row by row, the sum formula quickly gives the total number of seats and the most tickets you can sell.

Add up consecutive numbers in an instant (the story of young Gauss)

"What do you get when you add all the whole numbers from 1 to 100?" The famous story says the mathematician Gauss, as a child, answered at once: \(100 \times (1 + 100) \div 2 = 5050\). This is exactly the sum of the arithmetic sequence with first term 1, common difference 1 and 100 terms.
Totals of consecutive numbers, such as adding up the numbers on a run of invoices or stacking "1 on day 1, 2 on day 2, …", are instant with this formula.

Plan a workout or study load that grows little by little (training)

If you plan your runs as "2 miles in week 1, then 0.5 mile more each week", in week 12 you run \(2 + 11 \times 0.5 = 7.5\) miles, and the total over 12 weeks is \(12 \times (2 + 7.5) \div 2 = 57\) miles.
Before you start, you can check in numbers where a "a little more each time" plan takes you and how much it adds up to.

Simple interest (basic finance)

With simple interest, where interest is paid only on the original amount (the principal), the balance grows by the same amount every year, so it forms an arithmetic sequence. With $10,000 at 3% simple interest per year, it grows by $300 a year, and after 5 years the balance is \(10000 + 5 \times 300 = 11500\) dollars.
With compound interest, where interest also earns interest, the balance forms a geometric sequence (a sequence that grows by multiplying). The difference between simple and compound interest is "grow by adding, or grow by multiplying". Seeing it in terms of sequences makes financial products much easier to understand.

Formulas and graphs

Formula for the \(n\)th term (general term)
Graph
Standard notation (the usual math form)
\(a_n\) \(=\) \(a_1\) \(+\) \((n-1)\) \(\times\) \(d\)
In words (symbols replaced with words)
④ \(a_n\): \(n\)th term \(=\) ① \(a_1\): first term \(+\) ② \((n-1)\): number of steps \(\times\) ③ \(d\): common difference
The formula in words
① Start with the \(a_1\): first term , then add the
② \((n-1)\): number of steps times the
③ \(d\): common difference (that is, add the common difference \(n-1\) times)
④ and you get the \(a_n\): \(n\)th term
Quick example
For the arithmetic sequence with first term 2 and common difference 5 (2, 7, 12, 17, …), term 20 is
\(a_{20}\): term 20 \(=\) first term (2) \(+\) steps (20 − 1 = 19) \(\times\) common difference (5)
\(2 + (20 - 1) \times 5 = 2 + 95 = 97\)
Key idea
The most common mistake is multiplying by \(n\) instead of \(n-1\). Going from term 1 to term \(n\), you add the common difference once per step, and there are \(n-1\) steps, one fewer than \(n\). For example, from term 1 to term 3 you add only twice (\(3-1\) times). The formula works as is when the common difference \(d\) is negative. In that case, the values get smaller with each step.
Formula for the sum of the first \(n\) terms
Figure
Standard notation (the usual math form)
\(S_n\) \(=\) \(n\) \(\times\) \((\) \(a_1\) \(+\) \(a_n\) \()\) \(\div\) \(2\)
In words (symbols replaced with words)
⑤ \(S_n\): sum of terms 1 through \(n\) \(=\) ③ \(n\): number of terms \(\times\) \((\) ① \(a_1\): first term \(+\) ② \(a_n\): \(n\)th term (last term) \()\) \(\div\) ④ \(2\): take half
The formula in words
① Add the \(a_1\): first term and the
② \(a_n\): \(n\)th term (last term) ,
③ multiply by the \(n\): number of terms ,
④ then divide by \(2\): take half ,
⑤ and you get the \(S_n\): sum of terms 1 through \(n\)
Quick example
For the arithmetic sequence with first term 2 and common difference 5, the sum of terms 1 through 20 (term 20 is 97) is
\(S_{20}\): sum up to term 20 \(=\) number of terms (20) \(\times\) \((\) first term (2) \(+\) term 20 (97) \()\) \(\div\) take half (2)
\(20 \times (2 + 97) = 20 \times 99 = 1980\)
\(1980 \div 2 = 990\)
Key idea
\((a_1 + a_n) \div 2\) is the average of the first term and the last term. An arithmetic sequence goes up by the same amount every step, so the average of all its terms is exactly the average of the first and last terms. That is why the sum is "average × count". This is the whole idea of the formula. Textbooks write it as a fraction, \(S_n = \dfrac{n(a_1 + a_n)}{2}\). It is the same formula as above. "What is the sum of all whole numbers from 1 to 100?" is the sum of an arithmetic sequence with first term 1, last term 100 and 100 terms, so the answer is quick: \(100 \times (1 + 100) \div 2 = 5050\).
Formula for the sum straight from the first term and common difference
Standard notation (the usual math form)
\(S_n\) \(=\) \(n\) \(\times\) \(\{\) \(2a_1\) \(+\) \((n-1)\) \(\times\) \(d\) \(\}\) \(\div\) \(2\)
In words (symbols replaced with words)
⑥ \(S_n\): sum of terms 1 through \(n\) \(=\) ④ \(n\): number of terms \(\times\) \(\{\) ① \(2a_1\): twice the first term \(+\) ② \((n-1)\): number of steps \(\times\) ③ \(d\): common difference \(\}\) \(\div\) ⑤ \(2\): take half
The formula in words
① To \(2a_1\): twice the first term , add the
② \((n-1)\): number of steps times the
③ \(d\): common difference (this equals first term + last term),
④ multiply by the \(n\): number of terms ,
⑤ then divide by \(2\): take half ,
⑥ and you get the \(S_n\): sum of terms 1 through \(n\)
Quick example
With first term 2, common difference 5 and 20 terms, the sum calculated directly, without finding term 20 first, is
\(S_{20}\): sum up to term 20 \(=\) number of terms (20) \(\times\) \(\{\) twice the first term (2 × 2 = 4) \(+\) steps (19) \(\times\) common difference (5) \(\}\) \(\div\) take half (2)
\(2 \times 2 + (20 - 1) \times 5 = 4 + 95 = 99\)
\(20 \times 99 \div 2 = 990\)
Key idea
This is the first formula (the general term) substituted for \(a_n\) in the second formula. Since \(a_1 + a_n = a_1 + a_1 + (n-1)d = 2a_1 + (n-1)d\), you can get the sum straight from the first term and the common difference, without finding the last term \(a_n\) first. Textbooks write it as a fraction, \(S_n = \dfrac{n\{2a_1 + (n-1)d\}}{2}\). Both formulas give the same answer. Use the second formula when you know the last term, and this one when you only know the first term and the common difference.
An arithmetic sequence keeps adding the same number (the common difference). The \(n\)th term is "the first term plus the common difference added \(n-1\) times", and the sum is "(first term + last term) × number of terms ÷ 2", which is the average of the first and last terms times the count.

Symbols and terms

Symbols

\(a_1\) a sub one The first term. The very first term (number) of the sequence. For the sequence 2, 7, 12, 17, …, it is 2.
\(d\) dee The common difference. The difference between neighboring terms (how much each term goes up). For 2, 7, 12, 17, … it is 5. The letter comes from "difference", and it can be a negative number.
\(n\) en The number of terms. A positive whole number that says how far along the sequence you go. "Up to term 20" is \(n = 20\).
\(a_n\) a sub n The \(n\)th term. The \(n\)th number of the sequence. The small letter at the lower right (the subscript) tells which position it is. The \(n\)th term written as a formula in \(n\) is called the general term.
\(n-1\) n minus one The number of steps from term 1 to term \(n\), which is how many times you add the common difference. It is one fewer than the number of terms \(n\) (from term 1 to term 3 is 2 steps).
\(S_n\) S sub n The sum of terms 1 through \(n\). A short way to write \(a_1 + a_2 + \cdots + a_n\). The letter S comes from "sum".
\(\cdots\) dot dot dot (ellipsis) A symbol that says the pattern continues the same way. Writing 2, 7, 12, 17, … says the numbers keep going up by 5.

Terms

sequence A list of numbers in a set order. Each number in the list is called a term.
arithmetic sequence A sequence where the difference between neighboring terms is always the same, such as 2, 7, 12, 17, … (the difference is always 5). It is also called an arithmetic progression.
term Each single number in a sequence. From the start, they are called term 1, term 2, and so on.
first term The very first term of a sequence, that is, term 1. It is written \(a_1\).
common difference In an arithmetic sequence, the difference between neighboring terms. You get the same value whichever neighboring pair you subtract. It can be negative (for a decreasing sequence) or a decimal.
last term The very last term in the range you are looking at. For the sum of terms 1 through \(n\), the last term is \(a_n\).
general term The \(n\)th term written as a formula in \(n\), also called the explicit formula. For an arithmetic sequence it is \(a_n = a_1 + (n-1)d\). Put a position number in for \(n\) and you get that term right away.
geometric sequence A sequence where the ratio between neighboring terms is always the same, such as 2, 6, 18, 54, … (multiply by 3 each time). It grows differently from an arithmetic sequence, which adds the same number, so the formulas on this page do not apply.

Good to know before you start

Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back to review these topics is the fastest way forward.

Number patterns (Grades 4–5)
  • Being able to spot a rule such as "it goes up by 5 each time" in a list of numbers like 2, 7, 12, 17, …
  • Being able to make a table that pairs each position number with its value
Negative numbers (Grade 7)
  • Being able to add a negative number, as in \(10 + (-2) = 8\)
  • Being able to multiply by a negative number, as in \((6-1) \times (-2) = -10\)
Variables and expressions (Grade 6)
  • Knowing that letters such as \(n\) and \(a_1\) stand for numbers that can change
  • Being able to substitute, such as putting \(n = 20\) into \(n - 1\) to get 19
Order of operations (Grade 5)
  • Doing multiplication before addition (in \(2 + 19 \times 5\), do \(19 \times 5\) first)
  • Doing what is inside parentheses first (in \(20 \times (2 + 97)\), do \(2 + 97\) first)

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table to find the nth term (first term 2, common difference 5, 20 terms)
First term a1 2
Common difference d 5
Number of terms n 20
nth term =B1+(B3-1)*B2
Table to find the sum of terms 1 through n (using the nth term)
First term a1 2
Common difference d 5
Number of terms n 20
nth term =B1+(B3-1)*B2
Sum of terms 1 through n =B3*(B1+B4)/2
Table to find the sum straight from the first term and common difference
First term a1 2
Common difference d 5
Number of terms n 20
Sum of terms 1 through n =B3*(2*B1+(B3-1)*B2)/2
After pasting, cells B1 to B3 are the inputs and the bottom cell shows the calculated result.
In the formulas, "B1" and "B3" say "use the number in that cell", "*" is multiplication and "/" is division. "=B1+(B3-1)*B2" is the formula itself: "first term plus (number of terms − 1) × common difference".
For example, the first table shows 97 (term 20) in B4, and the second table shows 990 (the sum) in B5. Just replace B1 to B3 with your own numbers.

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table to find the nth term (first term 2, common difference 5, 20 terms)
First term a1 2
Common difference d 5
Number of terms n 20
nth term =B1+(B3-1)*B2
Table to find the sum of terms 1 through n (using the nth term)
First term a1 2
Common difference d 5
Number of terms n 20
nth term =B1+(B3-1)*B2
Sum of terms 1 through n =B3*(B1+B4)/2
Table to find the sum straight from the first term and common difference
First term a1 2
Common difference d 5
Number of terms n 20
Sum of terms 1 through n =B3*(2*B1+(B3-1)*B2)/2
The same formulas as in Excel work as is. Copy the whole table, paste it into cell A1, and replace B1 to B3 with your own numbers.

How to calculate it in Python

first_term = 2         # first term
common_difference = 5  # common difference
number_of_terms = 20   # number of terms

# nth term = first term + (n - 1) * common difference
nth_term = first_term + (number_of_terms - 1) * common_difference
# sum of terms 1 through n = n * (first term + nth term) / 2
sum_of_terms = number_of_terms * (first_term + nth_term) / 2
# first 10 terms of the sequence (for checking)
sequence = [first_term + k * common_difference for k in range(min(number_of_terms, 10))]

print(f"First terms: {sequence}")
print(f"Term {number_of_terms}: {nth_term}")
print(f"Sum of terms 1 through {number_of_terms}: {sum_of_terms}")
It runs with the standard library only. Change the three numbers at the top (first term, common difference, number of terms) and run it. This example prints 97 for term 20 and 990.0 for the sum. To show the sum as a whole number, change "/ 2" to "// 2" (integer division) when the first term and common difference are whole numbers.

How to write it in LaTeX and other math languages (copy and paste)

Formula for the \(n\)th term (general term)
aₙ = a₁ + (n − 1)d
a_n = a_1 + (n-1)d
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <msub><mi>a</mi><mi>n</mi></msub>
    <mo>=</mo>
    <msub><mi>a</mi><mn>1</mn></msub>
    <mo>+</mo>
    <mrow><mo>(</mo><mi>n</mi><mo>&#x2212;</mo><mn>1</mn><mo>)</mo></mrow>
    <mi>d</mi>
  </mrow>
</math>
a_n = a_1 + (n-1) d
a1 + (n - 1)*d
an := a1 + (n - 1)*d;
a_n = a1 + (n - 1)*d;
a_n = a_1 + (n - 1)d
Formula for the sum of the first \(n\) terms
Sₙ = n(a₁ + aₙ) ÷ 2
S_n = \dfrac{n(a_1 + a_n)}{2}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <msub><mi>S</mi><mi>n</mi></msub>
    <mo>=</mo>
    <mfrac>
      <mrow>
        <mi>n</mi>
        <mo>(</mo>
        <msub><mi>a</mi><mn>1</mn></msub>
        <mo>+</mo>
        <msub><mi>a</mi><mi>n</mi></msub>
        <mo>)</mo>
      </mrow>
      <mn>2</mn>
    </mfrac>
  </mrow>
</math>
S_n = (n(a_1 + a_n))/2
n*(a1 + an)/2
Sn := n*(a1 + an)/2;
S_n = n*(a1 + a_n)/2;
S_n = n(a_1 + a_n)/2
Formula for the sum straight from the first term and common difference
Sₙ = n{2a₁ + (n − 1)d} ÷ 2
S_n = \dfrac{n\{2a_1 + (n-1)d\}}{2}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <msub><mi>S</mi><mi>n</mi></msub>
    <mo>=</mo>
    <mfrac>
      <mrow>
        <mi>n</mi>
        <mo>{</mo>
        <mn>2</mn>
        <msub><mi>a</mi><mn>1</mn></msub>
        <mo>+</mo>
        <mrow><mo>(</mo><mi>n</mi><mo>&#x2212;</mo><mn>1</mn><mo>)</mo></mrow>
        <mi>d</mi>
        <mo>}</mo>
      </mrow>
      <mn>2</mn>
    </mfrac>
  </mrow>
</math>
S_n = (n(2 a_1 + (n-1) d))/2
n*(2*a1 + (n - 1)*d)/2
Sn := n*(2*a1 + (n - 1)*d)/2;
S_n = n*(2*a1 + (n - 1)*d)/2;
S_n = n(2a_1 + (n - 1)d)/2

How to have ChatGPT  do the calculation

You are an assistant for arithmetic sequence calculations. Do the following calculations by actually running Python code, and base your answer only on the numbers from the output (do not answer from mental math or guesses). Find the nth term with a_n = a_1 + (n-1)d and the sum with S_n = n(a_1 + a_n)/2.

1. Term 20 and the sum of terms 1 through 20 of the arithmetic sequence with first term 2 and common difference 5
2. Term 10 and the sum of terms 1 through 10 of the arithmetic sequence with first term -3 and common difference 4
3. Term 15 and the sum of terms 1 through 15 of the arithmetic sequence with first term 100 and common difference -7

Show the formulas you used and the numbers from the output.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.