Obviously a2=1, a3=1. For a≥4, if the first box contains a red ball, then so does the second one. Now we distinguish two types of configurations: those containing a red ball in the third box, and those with a blue or a white ball in the third box. In order to count the configurations of the first type, simply forget about the first box. We can easily see that there are an−1 configurations of this type. For the second type of configurations, we omit the first two boxes and obtain 2an−2 configurations. Thus, an=an−1+2an−2.
By induction, it is easy to prove that an=32n−1+(−1)n, hence In=2n−1+(−1)n. For n=11 we get I11=1023.