1. Lemma: We start by proving the lemma that Xα≡Xα+1(modpα+1), where p is a prime and Xα=(dpα−1dpαq−1).
2. Define f(x)=(x−1)(x−2)⋯(x−p+1), where p is a prime.
3. Using the definition of the binomial coefficient, expand Xα and Xα+1:
Xα+1−Xα=Xα(f(dpα+1)f(dpα+1−p)⋯f(p)f(dpα+1q)f(dpα+1q−p)⋯f(dpα+1q−dpα+1+p)−1)
4. Note that f(kp) is not a multiple of p.
5. We need to show:
f(dpα+1q)f(dpα+1q−p)⋯f(dpα+1q−dpα+1+p)≡f(dpα+1)f(dpα+1−p)⋯f(p)(modpα+1)
6. This is obvious because f(dpα+1q−kp)≡f(dpα+1−kp)(modpα+1) for any integer k.
7. This completes the proof of our lemma.
8. Main Problem: We need to prove that the sum of binomial coefficients:
k=0∑n−1(gcd(n,k)gcd(n,k)q)
is divisible by m.
9. It is equivalent to:
n∣d∣n∑(d−1dq−1)ϕ(dn)
10. Denote n=pαm where (m,p)=1. We need to show:
pα∣d∣m∑k=0∑α(dpk−1dpkq−1)ϕ(dpα−km)
11. We need to show pα∣Aα, where:
Aα=k=0∑α(dpk−1dpkq−1)ϕ(dpα−km)
12. Use induction on α.
13. Note that:
Aα+1=k=0∑α+1(dpk−1dpkq−1)ϕ(dpα+1−km)
14. Using properties of Euler's totient function:
ϕ(dmp)=(p−1)ϕ(dm),ϕ(dmpa)=pϕ(dma−1) for a>1
15. We get:
Aα+1=pAα+(dpα+1−1dqpα+1−1)ϕ(dm)−(dpα−1dqpα−1)ϕ(dm)
16. Thus:
Aα+1≡ϕ(dm)((dpα+1−1dqpα+1−1)−(dpα−1dqpα−1))≡0(modpα+1)
by the lemma.
17. This completes our induction.
■