Given a positive integer n and a valid X. to Calculate the value of the expression:

cos(x)+coscos(x)+...coscos cos(x), where...coscos cos(x) replaced by n.

Task on a cycle of odds.

I don't understand how it is to be replaced. Please help you can,preferably with code,but only without vectors