We will use the well-known fact that ν(n)=∑k=1∞⌊2kn⌋. If the base-2 form of the number n is n=dldl−1…d1d0=∑i=0∞di⋅2i, where the digits d0,…,dl are all 0 or 1, then
ν(n)=k=1∑∞⌊2kn⌋=k=1∑l⌊2kdldl−1…d1d0⌋=k=1∑ldldl−1…dk=k=1∑l(i=k∑ldi⋅2i−k)=i=1∑ldi(k=1∑i2i−k)=i=1∑ldi⋅(2i−1).
Now we will show that there exists an integer r which is relatively prime to m, and an infinite sequence i1<i2<i3<… of positive integers such that
2i1−1≡2i2−1≡2i3−1≡⋯≡rmodm.
Let m=2tu where u is odd, and consider an arbitrary positive integer i≥t for which φ(u) divides i−1. By the Euler-Fermat theorem,
u∣2φ(u)−1∣2i−1−1,
2i−1=2(2i−1−1)+1≡1mod u,
and, due to i≥t,
2i−1≡−1mod 2t.
The relations (1) and (2) determine the residue class of 2i−1 modulo m, and it must be relatively prime to m.
Since m and r are relatively prime, there is a positive integer u such that a≡urmodm. For n=2i1+⋯+2iu we achieve
ν(n)=ν(2i1+⋯+2iu)=(2i1−1)+⋯+(2iu−1)≡u⋅r≡amod m.