Let us consider the group G:=ZaN (the product of the cyclic group with N elements with itself a times). Suppose we are given a number m that divides N.

I would like to know how many elements x in G have the property that (N/m)x has order precisely m (and not any number dividing m).

For example, if a equals 1, and m=pα for p a prime, the number of such elements is N−N/p, if m=pαqβ, it is N−N/p−N/q+N/pq.

I expect that in general there might be a closed formula for this number, perhaps involving the Euler function ϕ. Can anyone produce it or give me a suggestion on a good reference where I could look for it?

**Answer**

Let Ord(m) be the number of elements of order m in ZaN, where m|N. A nice way to compute Ord(m) is to start from the observation

∑m|NOrd(m)=Na

and to apply Möbius inversion:

Ord(m)=∑d|mμ(m/d)da.

Ord(m) is multiplicative (if m and n are relatively prime, then Ord(mn)=Ord(m)Ord(n); cf. Chinese remainder theorem). Thus, it is not hard to work out Ord(m) in terms of how μ behaves on the prime-power factors of m. After a little algebra,

Ord(m)=ma∏prime p|m(1−1pa).

Notice that N has receded from the picture. Indeed, for m|N, let

Zam↪ZaN

be the obvious inclusion of abelian groups, mapping onto the subgroup of elements whose order divides m. Then the set of elements of order exactly m in Zam maps onto the set of elements of order exactly m in ZaN, so we are just counting the former set.

**Edit:** Oh wait, I didn’t quite answer your exact question, did I? But no problem: the number of x such that (N/m)x has order exactly m is just the inverse image of the set of order m elements w.r.t. the map

(N/m)⋅−:ZaN→ZaN.

This map has kernel of size (N/m)a, and the inverse image we want consists of Ord(m) many distinct cosets of this kernel. Thus, the answer to the actual question is

Na∏prime p|m(1−1pa).

**Attribution***Source : Link , Question Author : Math , Answer Author : Todd Trimble*