Problem:
Let be a positive integer. Define a sequence by , , and for each . Determine, with proof, the value of .
Problem:
Let be a positive integer. Define a sequence by , , and for each . Determine, with proof, the value of .
Solution:
Note that for all by repeatedly applying . Now let . Applying the given recursion to every term of except gives
Now we easily obtain by induction.
Solution:
Define a binary string to be good if it is the null string or of the form . Let be the number of good subsequences of when written in binary form. We see and because the trailing in cannot be part of a good subsequence. Furthermore, equals the number of good subsequences of that use the trailing in . We will show that this number is exactly .
Let be a good subsequence of that contains the trailing . If uses the last , remove both the last and the trailing from ; the result will be a good subsequence of . If does not use the last , consider the sequence where the trailing in is replaced by the last in (which is at the same position as the last in .) The map can be seen to be a bijection, and thus .
Now it is clear that for all . Consider choosing each binary string between and with equal probability. The probability that a given subsequence of length is good is . There are subsequences of length , so by linearity of expectation, the total expected number of good subsequences is
This is equal to the average of , therefore the sum is .