Maths Olympiad Prep

Library / HMMT February /918 of 1302

HMMT February, 2015

Combinatorics Difficulty 5.5 AIME, harder Prove it United States

Problem:

Count the number of functions f:Z→{’green’,’blue’}f: \mathbb{Z} \rightarrow\{\text{'green'}, \text{'blue'}\} such that f(x)=f(x+22)f(x)=f(x+22) for all integers xx and there does not exist an integer yy with f(y)=f(y+2)=’green’f(y)=f(y+2)=\text{'green'}.

Solution

Solution:

Answer: 3960139601

It is clear that ff is determined by f(0),…,f(21)f(0), \ldots, f(21). The colors of the 11 even integers are independent of those of the odd integers because evens and odds are never exactly 2 apart.

First, we count the number of ways to "color" the even integers. f(0)f(0) can either be 'green' or 'blue'. If f(0)f(0) is 'green', then f(2)=f(20)=’blue’f(2)=f(20)=\text{'blue'}. A valid coloring of the 8 other even integers corresponds bijectively to a string of 8 bits such that no two consecutive bits are 1. In general, the number of such length nn strings is well known to be Fn+2F_{n+2} (indexed according to F0=0,F1=1,Fn+2=Fn+1+FnF_{0}=0, F_{1}=1, F_{n+2}=F_{n+1}+F_{n}), which can be proven by recursion. Therefore, the number of colorings of even integers in this case is F10=55F_{10}=55.

If f(0)f(0) is 'blue', then a valid coloring of the 10 other even integers corresponds bijectively to a string as above, of 10 bits. The number of colorings for this case is F12=144F_{12}=144. The total number of colorings of even integers is 55+144=19955+144=199.

Using the same reasoning for coloring the odd integers, we see that the number of colorings of all of the integers is 1992=39601199^{2}=39601.

Want a route through all this instead of an archive? The track puts 2,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.