Q. If and where and then

 162  154 Sequences and Series Report Error

Solution:

Using A.M. G.M.