Question: Euler's totient function

I was asked to write a procedure according to the description as follow:

where https://en.wikipedia.org/wiki/Euler%27s_totient_function means the Euler's function.

Could someone help me? I struggle from the very beginning since

1.I don't know what code is responsible for "counting" element in maple

2.I don't know how to restrict my domain to Z

Thanks.  

Please Wait...