We consider the sequence of integers defined by:
* .
* If is even, .
* If is odd and is odd, then .
* If is odd and is even, then
a) Calculate .
b) Prove that is not periodic, that is, there do not exist positive integers and such that for every .
Problem 1400
Official solution
First of all, we note that the sequence is well defined: for each , , the value of is perfectly determined from the values of with .
We consider the sequence given by if the binary expression of has an even number of ones; and if the binary expression of has an odd number of ones. It is obvious that satisfies all the conditions that define , hence for every .
Thus, since is written in binary with 2020 ones,
Finally, let us see that the sequence is not periodic. Suppose that it were, from a value onward and with period . We take the integer, , such that . We observe that the binary expression of is obtained by replacing the first 1 (from the left) of the expression of with the two digits 10, so that . We take an integer such that . Now, we have:
If , then and therefore, .
If , then and therefore, .