I donot know how to solve this

unable to think about the solution

Just use while loop,keep generating next term of the series till the number of required terms are less than n1.
You can refer this and try to understand