Kai computes each of the 100 numbers (12), (24), (36), …, (100200), that is, (n2n) for n=1,2,…,100. How many of these 100 numbers are not divisible by 4?
Show solution
Solution
By Legendre's formula, v2(m!)=⌊m/2⌋+⌊m/4⌋+⋯=m−s(m), where s(m) is the number of 1's in the binary representation of m. (Each 1 in position j contributes 2j−1+2j−2+⋯+1=2j−1.) Since doubling does not change the binary digit sum, v2(n2n)=v2((2n)!)−2v2(n!)=(2n−s(n))−2(n−s(n))=s(n). So (n2n) is not divisible by 4 exactly when s(n)≤1, i.e., when n is a power of 2. For 1≤n≤100 these are 1,2,4,8,16,32,64: 7 values.
Tagged: 2-adic valuation of central binomial coefficients