For each even positive integer x, let g(x) denote the greatest power of 2 that divides x. For example, g(20)=4 and g(16)=16. For each positive integer n, let Sn=∑k=12n−1g(2k). Find the greatest integer n less than 1000 such that Sn is a perfect square.
解析
Solution 1
Given g:x↦maxj:2j∣x2j, consider Sn=g(2)+⋯+g(2n). Define S={2,4,…,2n}. There are 20 elements of S that are divisible by 2n, 21−20=20 elements of S that are divisible by 2n−1 but not by 2n,…, and 2n−1−2n−2=2n−2 elements of S that are divisible by 21 but not by 22.
Thus
Sn=20⋅2n+20⋅2n−1+21⋅2n−2+⋯+2n−2⋅21=2n+(n−1)2n−1=2n−1(n+1).
Let 2k be the highest power of 2 that divides n+1. Thus by the above formula, the highest power of 2 that divides Sn is 2k+n−1. For Sn to be a perfect square, k+n−1 must be even. If k is odd, then n+1 is even, hence k+n−1 is odd, and Sn cannot be a perfect square. Hence k must be even. In particular, as n<1000, we have five choices for k, namely k=0,2,4,6,8.
If k=0, then n+1 is odd, so k+n−1 is odd, hence the largest power of 2 dividing Sn has an odd exponent, so Sn is not a perfect square.
In the other cases, note that k+n−1 is even, so the highest power of 2 dividing Sn will be a perfect square. In particular, Sn will be a perfect square if and only if (n+1)/2k is an odd perfect square.
If k=2, then n<1000 implies that 4n+1≤250, so we have n+1=4,4⋅32,…,4⋅132,4⋅32⋅52.
If k=4, then n<1000 implies that 16n+1≤62, so n+1=16,16⋅32,16⋅52,16⋅72.
If k=6, then n<1000 implies that 64n+1≤15, so n+1=64,64⋅32.
If k=8, then n<1000 implies that 256n+1≤3, so n+1=256.
Comparing the largest term in each case, we find that the maximum possible n such that Sn is a perfect square is 4⋅32⋅52−1=899.
Solution 2
First note that g(k)=1 if k is odd and 2g(k/2) if k is even. so Sn=∑k=12n−1g(2k).=∑k=12n−12g(k)=2∑k=12n−1g(k)=2∑k=12n−2g(2k−1)+g(2k).2k−1 must be odd so this reduces to 2∑k=12n−21+g(2k)=2(2n−2+∑k=12n−2g(2k)). Thus Sn=2(2n−2+Sn−1)=2n−1+2Sn−1. Further noting that S0=1 we can see that Sn=2n−1⋅(n−1)+2n⋅S0=2n−1⋅(n−1)+2n−1⋅2=2n−1⋅(n+1). which is the same as above. To simplify the process of finding the largest square Sn we can note that if n−1 is odd then n+1 must be exactly divisible by an odd power of 2. However, this means n+1 is even but it cannot be. Thus n−1 is even and n+1 is a large even square. The largest even square <1000 is 900 so n+1=900=>n=899
Solution 3 (Finding patterns and using recursion)
At first, this problem looks kind of daunting, but we can easily solve this problem by finding patterns, recursion and algebraic manipulations.
We first simplify all the messy notation in the Sn term. Note that the problem asks us to find the smallest value of n<1000 such that there exists an integer k that satisfies
k2=g(2)+g(4)+⋯+g(2n)
.
Since there is no obvious way to approach this problem, we start by experimenting with small values of n to evaluate some Sn.
We play with these values:
S1=g(2)=2S2=g(2)+g(4)=2+4=6S3=g(2)+g(4)+g(6)+g(8)=16S4=g(2)+g(4)+g(6)+g(8)+g(10)+g(12)+g(14)+g(16)=40
We are certainly not going to expand all of this out... so let's look for patterns from these 4 values!
Using a little bit of ingenuity, we note that
S2=2+4=S1+4S3=2+4+2+8=8+8=S2+S1+8S4=2+4+2+8+2+4+2+16=S3+S2+S1+16
Aha! We see powers of two in each of our terms! Therefore, we can say that
S2=S1+22S3=S2+S1+23S4=S3+S2+S1+24
Hooray! We have a recursion! Realistically, we would want to prove that the recursion works, but I currently don't know how to prove it.
On the actual AIME, go with whatever patterns you see, because most likely those are the patterns that the test-makers want the students to see.
So we may generalize a formula for Sn:
Sn=2n+Sn−1+Sn−2+⋯+S2+S1
Uh oh... this formula is not in closed form. Looks like we'll have to use our recursion to develop one manually. We do so by using our recursion for Sn−1:
Sn=2n+(2n−1+Sn−2+Sn−3+⋯+S2+S1)+Sn−2+Sn−3+⋯+S2+S1Sn=2n+2n−1+2(Sn−2+Sn−3+⋯+S2+S1
Let's simplify a bit further, where we use our recursion for Sn−2.
Sn=2n+2n−1+(2Sn−2)+2(Sn−3+Sn−4+⋯+S2+S1)Sn=2n+2n−1+2(2n−2)+2(Sn−3+Sn−4+⋯+S2+S1)+2(Sn−3+Sn−4+⋯+S2+S1)Sn=2n+2n−1+2n−1+4(Sn−3+Sn−4+⋯+S2+S1)
We now see a pattern! Using the exact same logic, we can condense this whole messy thing into a closed form:
Sn=2n+n−22n−1+2n−2(S1)Sn=2n+2n−1(n−2)+2n−1Sn=2n+2n−1(n−1)Sn=2n−1(2+(n−1)Sn=2n−1(n+1)
We have our closed form, so now we can find the largest value of n such that Sn is a perfect square.
In order for Sn to be a perfect square, we must have n−1 even and n+1 be a perfect square.
Since n<1000, we have n+1<1001. We first try n+1=312=961(since it is the smallest square below 1000, which gives us n=960. But n−1 isn't even, so we discard this value.
Next, we try the second smallest value, which is n=302=900, which tells us that n=899. n−1 is indeed even, and n+1 is a perfect square, so the largest value of n such that Sn is a perfect square is 899.
Our answer is 899.
-FIREDRAGONMATH16
Solution 4
First, we set intervals. Say that a number N falls strictly within [2k,2k+1].
N<2k+1=2k+2k
We can generalize this:
If a number is in the form N=2k+2RO where O is a positive odd number, $R:
N<2k+1=2k+2k⟹O<2k−R so there are 2k−R−1 numbers that satisfy this form. For all numbers that satisfy this form, g(N)=2R. The sum of g(N) for all N in this form and interval is 2k−1. R can vary between 1 and k−1, so the total sum is k−12k−1+2k−1⋯2k−1=(k−1)2k−1. The domain of the function we are trying to find is all even integers in the interval [21,2n] so there are n−1 values of k. Now we have the sum ∑k=1n−1(k−1)2k−1=∑i=1n−2k⋅2k. However, we did not consider powers of two yet(since our interval was strictly between powers of 2), so we have to add ∑k=1n2k. Note that ∑i=1n−2k⋅2k=(21+22⋯2n−2)+(22+23⋯2n−2)⋯+(2n−3+2n−2)+2n−2=21(2n−2−1)+22(2n−3−1)⋯+2n−3(22−1)+2n−2(21−1)=(n−2)(2n−1)−∑k=1n−22k=(n−2)(2n−1)−2(2n−2−1)=(n−3)(2n−1)+2. Adding ∑k=1n2k=2(2n−1), we get (n+1)(2n−1). If this sum is a perfect square, n≡0(mod2), since that would make 2n−1 not a perfect square, and n+1 odd so it cannot contribute a factor of 2 to make the power of 2 a perfect square.
We want the least odd number less than 1000 such that (n+1) is an even perfect square. The greatest even square less than 1000 is 302=900 so n+1=900⟹n=899