Ratio of mth and nth terms of an A . P . with given ratio of sums | function to calculate ratio of mth and nth term ; ratio will be tm / tn = ( 2 * m - 1 ) / ( 2 * n - 1 ) ; Driver code
< ? php function CalculateRatio ( $ m , $ n ) { return ( 2 * $ m - 1 ) / ( 2 * $ n - 1 ) ; } $ m = 6 ; $ n = 2 ; echo CalculateRatio ( $ m , $ n ) ; ? >