Wang-Sun Formula in $\overrightarrow{GL}(\mathbb{Z}/2k\mathbb{Z})$

Wang and Sun proved a certain summatory formula involving derangements and primitive roots of the unit. We study such a formula but for the particular case of the set of affine derangements in $\overrightarrow{GL}(\mathbb{Z}/2k\mathbb{Z})$ and its subset of involutive affine derangements in particular; in this last case its value is relatively simple and it is related to even unitary divisors of $k$.


Introduction
In [5], for n > 1 an odd integer and ζ a n-th primitive root of unity, Wang and Sun proved that π∈D(n−1) sign(π) where D(n − 1) is the set of all derangements within S n−1 .
For the mathematical theory of counterpoint it is not the whole of S n−1 as important as it is the general affine linear group → GL(Z 2kZ) ∶= {e u .v}u∈Z 2kZ,v∈Z 2kZ × .
We are interested not only in plain derangements but in particular in those that are involutive, i.e., they are their own inverses.Affine involutive derangements are called quasipolarities, and its set within → GL(Z 2kZ) will be denoted with Q k .They are important because they relate consonances (K) and dissonances (D) in 2k-tone equal temperaments; more precisely, if Z 2kZ = K ⊔D and q is a quasipolarity, then it is the unique affine morphism such that q(K) = D (see [3] for details).
The structure of the article is as follows: first we prove the sum for quasipolarities in Section 2. Then we calculate using code in Maxima some values of the sum for derangements in → GL(Z 2kZ) in Section 3 and finally we make some remarks in Section 4.

The case of quasipolarities
Note first that all quasipolarities have the same sign as permutations, so we can disregard it in the original Wang-Sun formula.
Theorem 1.If k is odd and ζ a 2k-th primitive root of unity, then thus it suffices to prove that this happens for any quasipolarity π = e u .v∈ Q k for some 0 ≤ j ≤ 2k − 1.From [1, Theorem 3.1], we know that where σ(v) = gcd(v − 1, 2k), τ (v) = gcd(v + 1, 2k) and q is any integer.Now, we want to show that there is a j such that which is possible if, and only if, gcd(1 − v, 2k) (k + u).In other words, if and only if σ(v) (k + u).Using (1), this can be rewritten as for some integer q.Thus, if we can show that the congruence has a solution for x, then we will be done.Indeed, σ(v) = 2I 1 and τ (v) = 2I 2 for some I 1 , I 2 odd and coprime divisors of k.The linear Diophantine equation has a solution since the GCD of the the coefficients on the left is 2 and the number on the right is even.Hence, if (x, y) is a solution, then which shows that x is the required solution.
Table 1.Results of the evaluation of the sum S of Theorem 1 for some values of k.
k 3 4 5 6 7 8 9 10 11 12 S 0 4 0 8 0 8 0 12 0 16 While this result was relatively easy to conjecture considering a few values of the sum for some k (as they can be seen in Table 1), it is less easy to make a guess for the sum when k is even, but the following seems reasonable.
The search of the sequence 4, 8, 8, 12 in the Online Encyclopedia of Integer Sequences (OEIS) [4] yields as first result A054785, which is the difference of the sum of divisors of 2n and n.The values match up to k = 16, but they differ at k = 18, where the former is 20 and the later is 26.Nonetheless, the results from [2] lead us in the right direction.We need some definitions first.Definition 1.A divisor d of n is said to be unitary if d ⊥ n d; we denote that d is a unitary divisor of n with d n.We have the sum of unitary divisors function In [2] it is proved that Proof.We have already proved the case when k is odd, so suppose k is even.If π = e u .v∈ Q k and j − π(j) ≢ k (mod 2k) so the summand associated to π is not 0, then we require the congruence (2) to have no solutions for j; this happens if and only if . Hence (2) has no solutions if and only if We know σ(v) = 2I 1 and τ (v) = 2I 2 where thus I 1 and I 2 are unitary divisors of k.By [2, Proposition 2.3], we know that both I 1 and I 2 represent involutions of Z 2kZ.If I 1 is odd, then I 2 > 0 is even and the associated involution defines 2k σ(v) = I 2 quasipolarities.In particular, 2I 1 = σ(v) divides k.Furthermore, τ (v) is divisible by 4 and σ(v) does not divide σ(v) 2, thus (3) holds.Conversely, if (3) is true then I 2 has to be even for otherwise which contradicts (3).
For every π = e u .vwith its linear part v represented by an even unitary divisor of k and every 0 ≤ j ≤ 2k − 1, we claim that there is an ℓ such that (j − π(j)) − (ℓ − π(ℓ)) ≡ k (mod 2k), for this is equivalent to , it implies that there exist a solution ℓ.Therefore, for a summand indexed by π such that j − π(j) ≠ k for every 0 ≤ j ≤ 2k − 1 and has a factor 1 + ζ j−π(j) in the denominator, it also has a factor in the numerator, so all the factors cancel out and the summand equals 1.
Thus we have to sum the number of even unitary divisors of k.This is accomplished by s

The case of the derangements of the general affine group
Let us denote the derangements within → GL(Z 2kZ) with ∆ k .The following code in Maxima calculates for the particular case of k = 4.
As far as my computer's memory and simplification capacity of Maxima allow, we calculated S for k = 3, . . ., 9 mutatis mutandis.The results are contained in Table 2. Except for the sign and the prime factors of k in the denominator, no other pattern is evident and searches in the OEIS do not point yet in a meaningful direction.

Some final remarks
An interesting outcome of Theorem 1, from the musicological viewpoint, is that for 2k-tone equal temperaments with k even, there is always a quasipolarity such that a consonance and a dissonance are separated by a tritone (which always corresponds to k).
When k is odd, the proof of Theorem 2 tells us that Wang-Sun sum counts quasipolarities represented by even unitary divisors along the direction of [2], so it suggest that we should explore more deeply the relationship between the two concepts and its musicological implications.
For the Wang-Sun sum over all affine derangements we could not prove or conjecture a general formula, and thus we stress the nontriviality of studying it for derangements within subgroups.

Table 2 .
Results of the execution of the code.