Let N be the number of ways to write 2010 in the form 2010=a3⋅103+a2⋅102+a1⋅10+a0, where the ai's are integers, and 0≤ai≤99. An example of such a representation is 1⋅103+3⋅102+67⋅101+40⋅100. Find N.
解析
Solution 1
If we choose a3 and a1 such that (103)(a3)+(10)(a1)≤2010 there is a unique choice of a2 and a0 that makes the equality hold. So N is just the number of combinations of a3 and a1 we can pick. If a3=0 or a3=1 we can let a1 be anything from 0 to 99. If a3=2 then a1=0 or a1=1. Thus N=100+100+2=202.
Solution 2
Note that a2⋅102+a0 is the base 100 representation of any number from 0 to 9999, and similarly 10(a3⋅102+a1) is ten times the base 100 representation of any number from 0 to 9999. Thus, the number of solutions is just the number of solutions to 2010=10a+b where 0≤a,b≤9999, which is equal to 202 as a can range from 0 to 201.
Solution 3
Note that a0≡2010(mod10) and a1≡2010−a0(mod100). It's easy to see that exactly 10 values in 0≤a0≤99 that satisfy our first congruence. Similarly, there are 10 possible values of a1 for each choice of a0. Thus, there are 10×10=100 possible choices for a0 and a1. We next note that if a0 and a1 are chosen, then a valid value of a3 determines a2, so we dive into some simple casework:
If 2010−10a1−a0≥2000, there are 3 valid choices for a3. There are only 2 possible cases where 2010−10a1−a0≥2000, namely (a1,a0)=(1,0),(10,0). Thus, there are 3×2=6 possible representations in this case.
If 2010−10a1−a0<1000, a3 can only equal 0. However, this case cannot occur, as 10a1+a0≤990+99=1089. Thus, 2010−10a1−a0≥921. However, 2010−10a1−a0=1000a3+100a2≡0(mod100). Thus, we have 2010−10a1−a0≥1000 always.
If 1000≤2010−10a1−a0<2000, then there are 2 valid choices for a3. Since there are 100 possible choices for a0 and a1, and we have already checked the other cases, it follows that 100−2−0=98 choices of a0 and a1 fall under this case. Thus, there are 2×98=196 possible representations in this case.
Our answer is thus 6+0+196=202.
Solution 4: Casework and Brute Force
We immediately see that a3 can only be 0, 1 or 2. We also note that the maximum possible value for 10a1+a0 is 990+99=1089. We then split into cases:
Case 1: a3=0. We try to find possible values of a2. We plug in a3=0 and 10a1+a0=1089 to our initial equation, which gives us 2010=0+100a2+1089. Thus a2≥10. We also see that a2≤20. We now take these values of a2 and find the number of pairs (a1,a0) that work. If a2=10, 10a1+a0=1010. We see that there are 8 possible pairs in this case. Using the same logic, there are 10 ways for a2=11,12…19. For a2=20, we get the equation 10a1+a0=10, for 2 ways. Thus, for a3=0, there are 8+10⋅9+2=100 ways.
Case 2: a3=1. This case is almost identical to the one above, except 0≤a2≤10. We also get 100 ways.
Case 3: a3=2. If a3=2, our initial equation becomes 100a2+10a1+a0=10. It is obvious that a2=0, and we are left with 10a1+a0=10. We saw above that there are 2 ways.
Totaling everything, we get that there are 100+100+2=202 ways.
Solution 5: Generating Functions
We will represent the problem using generating functions. Consider the generating function
f(x)=(1+x1000+x2000+⋯+x99000)(1+x100+x200+⋯+x9900)(1+x10+x20+⋯+x990)(1+x+x2+⋯+x99)
where the first factor represents a3, the second factor a2, and so forth. We want to find the coefficient of x2010 in the expansion of f(x). Now rewriting each factor using the geometric series yields
f(x)=x−1x100−1⋅x10−1x1000−1⋅x100−1x10000−1⋅x1000−1x100000−1=x−1x10000−1⋅x10−1x100000−1=(1+x+x2+⋯+x9999)(1+x10+x20+⋯+x99990)
The coefficient of x2010 in this is simply 202, as we can choose any of the first 202 terms from the second factor and pair it with exactly one term in the first factor.
~rzlng
Solution 5
First note that a3 has to be a single-digit number(0, 1, or 2 to be exact), and that a1 has to be a two-digit multiple of ten. Then, a3, a2, a1 and a0 can be represented as follows:
a3=aa2=10b+ca1=10d+ea0=10f
, where a, b, c, d, e, and f are all(not necessarily nonzero) digits. Now, we can write our given equation as follows:
2010=1000(a+b)+100(c+d)+10(e+f)201=100(a+b)+10(c+d)+(e+f)201=(100a+10c+e)+(100b+d+f)
Now, each integer between 0 and 201 inclusive can be represented in exactly one way as 100a+10c+e, and this corresponds with one unique 100b+d+f, so it remains to count the number of integers between 0 and 201 inclusive. This is easily counted to be 202.
Solution 6
Just note that this corresponds to 0≤103⋅a3+102⋅a2+101⋅a1≤2010, because we can use a0 to fill in the remaining gap. Then, dividing by 10, we have 0≤a3a2a1≤201, of which there are 202 solutions.