A cute math problem from a kdrama (crash course in romance) of all places. Transcription may not be perfect because I could only read the math symbols. Apologies for the raw latex.
Say we have a sequence a_i and a mystery integer p with the following recursion:
a_{n+2} = (a_{n+2})^2/a_{n+1} if n + 1 <= p
or a_{n+1}/2 if n + 1 > p,
And a_1 = 1, and a_2 = 2.
Now suppose that \sum_{n=1}^21 log_2(a_n) = 0.
Find p. Answers below!
First, just out of random curiosity, let's write out some terms computed by hand in the form of 2^n. We get:
a_1 = 2^0, a_2 = 2^1, a_3 = 2^2, a_4 = 2^3, ...
What an interesting and convenient pattern! Convince yourself that it holds until we reach p, at which point the exponents start going down by 1 each step.
Now let's think about the sum itself. Recall that log_2(2^n) = n, so really what the sum is doing is summing up the exponents of the terms in the sequence. Again, how convenient! Now, if we keep that in mind and work out where the exponents start descending (careful of fencepost errors), we figure out that the sum looks like this:
Highlight the numbers: this helps you copy them more accurately.
Highlight the negatives
Full Check: yes, you did do a partial check mid-problem putting the variables back in the equation but I also want you to go back all the way to defining the variables and check that too.