Q. If and where and then

 163  154 Sequences and Series Report Error

Solution:

Using A.M. G.M.