JavaScript Program to find nth term of Arithmetic Progression Last Updated : 14 Mar, 2024 Comments Improve Suggest changes Like Article Like Report Arithmetic progression is a sequence of numbers in which the difference between any two consecutive terms is always equal. This difference between any two consecutive terms is known as a common difference and it can be positive, negative or zero. The nth term of A.P. in mathematics is calculated by using the nth term formula which is described as follows: Syntax:an = a + (n-1) × dParameters:a: It is the first term of the A.P. series.n: It is the position or index of the term in the A.P. series. d: It is a common difference between the two terms of an A.P.an: It is the nth term in the A.P. seriesExample: To demonstrate finding the the nth terms in the A.P. series using the function which uses the nth term formula to calculate the nth terms of an A.P, series to print the result. JavaScript // Define the function to find the nth term of A.P. function findNthTerm(firstTerm, commonDifference, n) { return firstTerm + (n - 1) * commonDifference; } // First term of the A.P. const firstTerm = 2; // Common difference of the A.P. const commonDifference = 3; // The nth term we want to calculate const n = 15; // Call the function const nthTerm = findNthTerm(firstTerm, commonDifference, n); console.log( `The ${n}-th term of the arithmetic progression is: ${nthTerm}`); OutputThe 15-th term of the arithmetic progression is: 44 Time Complexity : O(1) , constant time Space Complexity : O(1), constant space Comment More infoAdvertise with us Next Article JavaScript Program to find nth term of Arithmetic Progression B bug8wdqo Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Program Similar Reads JavaScript Program to find nth term of Geometric Progression Geometric Progression is a sequence of numbers in which each term is obtained by multiplying the previous term by a constant number called the common ratio. In this article, we will learn how to find the nth term of Geometric Progression using JavaScript. We will explore various approaches that can 4 min read JavaScript Program for nth Term of Geometric Progression In this article, we are going to learn how to find the nth term of Geometric Progression using JavaScript. We will see different approaches that will return the nth term of G.P. Geometric Progression is a sequence of numbers whose next term is calculated by multiplying the current term with a fixed 4 min read JavaScript Program for Sum of n Terms of Arithmetic Progression Arithmetic progression is a sequence of numbers in which the difference between any two consecutive terms is always equal. This difference between any two consecutive terms is known as a common difference and it can be positive, negative, or zero. Below are the approaches to find Sum of n terms in A 4 min read JavaScript Program for Sum of n terms of Geometric Progression Geometric Progression is a sequence of numbers whose next term is calculated by multiplying the current term with a fixed number known as a common ratio. We are going to learn how we can find the sum of n in terms of Geometric Progression in different ways using JavaScript including iteration, recur 3 min read Arithmetic Progression â Sum of First n Terms | Class 10 Maths Arithmetic Progression is a sequence of numbers where the difference between any two successive numbers is constant. For example 1, 3, 5, 7, 9â¦â¦. is in a series which has a common difference (3 â 1) between two successive terms is equal to 2. If we take natural numbers as an example of series 1, 2, 8 min read Like