Given first term (a), common difference (d) and a integer n of the Arithmetic Progression series, the task is to print the series.
Input : a = 5, d = 2, n = 10 Output : 5 7 9 11 13 15 17 19 21 23
We know the Arithmetic Progression series is like = 2, 5, 8, 11, 14 …. …
In this series 2 is the stating term of the series .
Common difference = 5 – 2 = 3 (Difference common in the series).
so we can write the series as :
t1 = a1
t2 = a1 + (2-1) * d
t3 = a1 + (3-1) * d
tn = a1 + (n-1) * d
2 3 4 5 6
- PHP program to print an arithmetic progression series using inbuilt functions
- Program for N-th term of Arithmetic Progression series
- Program for N-th term of Geometric Progression series
- Program to print GP (Geometric Progression)
- Program for sum of arithmetic series
- Arithmetic Progression
- Longest Arithmetic Progression | DP-35
- Ratio of mth and nth term in an Arithmetic Progression (AP)
- Count of AP (Arithmetic Progression) Subsequences in an array
- Find the missing number in Arithmetic Progression
- Check whether Arithmetic Progression can be formed from the given array
- Longest arithmetic progression with the given common difference
- Change one element in the given array to make it an Arithmetic Progression
- Convert given array to Arithmetic Progression by adding an element
- Minimum De-arrangements present in array of AP (Arithmetic Progression)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.