How many times can a student skip class in a 14 weeks semester? In a 14 weeks semester there are 5 school days each week. Johnny chooses each day if he goes to the University or skips the day. In how many ways can Johnny choose his attendance during the semester assuming he is not willing to skip the same day, two weeks in a row.
What I've done so far: I was thinking of a 5 digits long binary strings. $1$ stands for going to the University and $0$ stands for skip. Two adjacent strings can not have $0$ at the same index.
In this way, Johnny have $2^5$ options for the first week, and for further weeks he have $2^5$ $- \space$$(5-$'Sum of $1$'s in past week'$)$.
I don't know how to translate it into a formula or a function.
 A: The question becomes quite a bit easier to think about when you realize that the five weekdays are independent. Thus, if there are $r$ ways to handle a given weekday, there are $r^5$ options in total.
For a given weekday, add a $15$th week, attach a non-skipped day after each skipped day, and consider in how many ways individual non-skipped days and pairs of skipped-plus-non-skipped days can be arranged. This is
$$
r=\sum_{k=0}^7\binom{15-k}k=987
$$
(Wolfram|Alpha computation), where $k$ is the number of skipped days.
If you want to avoid adding up the eight binomial coefficients, you can also derive the result using a recurrence relation. If for $m$ weeks there are $a_m$ options ending in a skipped day and $b_m$ options ending in a non-skipped day, then $a_{m+1}=b_m$ and $b_{m+1}=a_m+b_m$, so $b_{m+2}=b_{m+1}+b_m$ and thus also $c_{m+2}=c_{m+1}+c_m$ for $c_m=a_m+b_m$. This together with the initial conditions $c_0=1$ and $c_1=2$ shows that $c_m=F_{m+2}$, the $(m+2)$-th Fibonacci number, with $F_{16}=987$.
