Question: A room is lit by $2$ bulbs. Bulbs are replaced only when both bulbs burn out. Lifetimes of bulb's are i.i.d exponentially distributed with parameter $λ=1$. What fraction of the time is the room only half-lit?

Answer: 
Since $p\equiv a^2\equiv 1 \pmod 8$, $2$ is a quadratic residue modules $p$. 
As a result $2^{\frac{p^2-1}8}\equiv 2^{\frac{p-1}{2}\cdot\frac{p+1}2}\equiv 1^{\frac{p+1}2}\equiv 1\pmod p$
First observe that $p \neq 2$. If $p=2$ then $a^2 \equiv 0 \mod 2$ and so $a^2$ and hence $a$ must be divisible by 2. But that implies that $a^2$ is divisble by 4 and since $64b^2$ also is, $p$ must be divisble by 4 and cannot be equal to 2. 

Now use a consequence of Fermat's little theorem that says that $a^{p-1} \equiv 1 \pmod p$ for a prime $p$ and a number $a$ that is not divisble by $p$ and rewrite the expression:

$2^{\frac{p^2-1}{4}}=(2^{p-1})^{\frac{p+1}{4}}\equiv 1^{\frac{p+1}{4}}=1 \mod p.$