Given two values ‘m’ and ‘n’ and the 5th term of an arithmetic progression is zero. The task is to find the ratio of mth and nth term of this AP.
Input: m = 10, n = 20 Output: 1/3 Input: m = 10, n = 15 Output: 1/2
Approach: Acc. to the statement, 5th term is zero. Now understand the concept with an example. As A5=a+4*d=0.
Now, we have to find ratio of m = 10th term and n = 20th term.
= A + 9 * d
= A5 + 5 * d
= 0 + 5 * d
= 5 * d
= A + 19 * d
= A5 + 15 * d
= 0 + 15 * d
= 15 * d
Now, we have to find ratio, so Ans= A / A
Below is the required implementation:
- Program for N-th term of Arithmetic Progression series
- Arithmetic Progression
- Longest Arithmetic Progression | DP-35
- Program for N-th term of Geometric Progression series
- Longest arithmetic progression with the given common difference
- Find the missing number in Arithmetic Progression
- Program to print Arithmetic Progression series
- Count of AP (Arithmetic Progression) Subsequences in an array
- Check whether Arithmetic Progression can be formed from the given array
- 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)
- PHP program to print an arithmetic progression series using inbuilt functions
- Longest string in non-decreasing order of ASCII code and in arithmetic progression
- Ratio of mth and nth terms of an A. P. with given ratio of sums
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.