For each positive integer n, define f(n) by f(n)={n100−n100(if digit sum of n is even),(if digit sum of n is odd). Let S=f(1)+f(2)+⋯+f(10100−1), and determine the largest non-negative integer m such that S is divided by 5m. (You can use the fact without proof that S is nonzero.)
Solution
In the following, we denote d=100 and let f(0)=0. Note that S=f(0)+f(1)+⋯+f(10d−1). For any integer n such that 0≤n≤10d, there exists unique (a0,a1,…,ad−1) with 0≤ai≤9 (i=0,1,…,d−1) such that n=a0+a1⋅10+⋯+ad−1⋅10d−1. If n>0, f(n)=(−1)a0+a1+⋯+ad−1(a0+a1⋅10+⋯+ad−1⋅10d−1)d(∗)
(and it is obvious to check it also holds for n=0). Hence, S equals to the sum of (∗) for all (a0,a1,…,ad−1) with 0≤ai≤9 (i=0,1,…,d−1). By multinomial theorem, (a0+a1⋅10+⋯+ad−1⋅10d−1)d=d∑b0+⋯+dd−1=d,bi≥0∑b0!b1!…bd−1!d!bi=0∏(ai⋅10i)bi=d∑b0+⋯+dd−1=d,bi≥0∑b0!b1!…bd−1!d!bi=0∏10ibibi=0∏aibi. Since b0!b1!…bd−1!d!∏bi=010ibi is independent of (a0,a1,…,ad−1), it suffices to compute, for each (b0,b1,…,bd−1), a0=0∑9⋯ad−1=0∑9(−1)a0+a1+⋯+ad−1bi=0∏aibi.
In the case where bk=0 for some 0≤k≤d−1, it equals zero since ak=0∑9(−1)a0+a1+⋯+ak+⋯+ad−1bi=0∏aibi=(ak=0∑9(−1)a0+a1+⋯+ak+⋯+ad−1)bi=0∏aibi=(1⋅5+(−1)⋅5)bi=0∏aibi=0.
In the case where bk=0 for all k, i.e. b0=b1=⋯=bd−1=1, (−1)a0+a1+⋯+ad−1bi=0∏aibi=(−1)a0+a1+⋯+ad−1i=0∏d−1ai=i=0∏d−1((−1)ai⋅ai).
i=0∏d−1(ai=0∑9((−1)ai⋅ai))=(−5)d.
b0=b1=⋯=bd−1=1 implies b0!b1!…bd−1!d!bi=0∏10ibi=d!i=0∏d−110i=d!⋅102d(d−1), and hence S=d!⋅102d(d−1)⋅(−5)d=100!⋅24950⋅55050. This concludes that the answer is ⌊51100⌋+⌊52100⌋+5050=5074.
Want a route through all this instead of an archive? The track
puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.
Source: MathNet,
licensed CC-BY-4.0.
Statement reproduced verbatim; metadata (topic, difficulty) added by this project.