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
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- 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)
- Find the missing number in Arithmetic Progression
- Longest arithmetic progression with the given common difference
- Check whether Arithmetic Progression can be formed from the given array
- Count of AP (Arithmetic Progression) Subsequences in an array
- Minimum De-arrangements present in array of AP (Arithmetic Progression)
- Count common elements in two arrays which are in Arithmetic Progression
- Convert given array to Arithmetic Progression by adding an element
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.