A sequence of integers is defined as follows: $a_i = i$ for $1 \le i \le 5,$ and
\[a_i = a_1 a_2 \dotsm a_{i - 1} - 1\]for $i > 5.$  Evaluate $a_1 a_2 \dotsm a_{2011} - \sum_{i = 1}^{2011} a_i^2.$
Hey, what's the value of $a_6$? I see. So $f(5) = 1 \cdot 2 \cdot 3 \cdot 4 \cdot 5 - (1^2 + 2^2 + 3^2 + 4^2 + 5^2) = 120 - 55 = 65.$ Right, and $f(6) = 1 \cdot 2 \cdot 3 \cdot 4 \cdot 5 \cdot (1 \cdot 2 \cdot 3 \cdot 4 \cdot 5 - 1) - (1^2 + 2^2 + 3^2 + 4^2 + 5^2 + (1 \cdot 2 \cdot 3 \cdot 4 \cdot 5 - 1)^2)$. Right. So we notice that $f(i)=f(i-1)-1$ for all $i>5$. First, we check the base case $i=6$, which we have already done. Now, let's assume that $f(i)=f(i-1)-1$ for some $i\ge6$. We will show that $f(i+1)=f(i)-1$. We have $f(i+1)=a_1 a_2 \dotsm a_{i+1} - \sum_{j = 1}^{i+1} a_j^2$ and $f(i)=a_1 a_2 \dotsm a_{i} - \sum_{j = 1}^{i} a_j^2$. So we need to prove that $a_1 a_2 \dotsm a_{i+1} - \sum_{j = 1}^{i+1} a_j^2=a_1 a_2 \dotsm a_{i} - \sum_{j = 1}^{i} a_j^2-1$. So we need to find $f(2011)$. We know that $f(5)=65$ and that $f(i)=f(i-1)-1$ for all $i>5$. So $f(6)=64$, $f(7)=63$, and so on. We need to find $k$ such that $5+k=2011$ So, $k=2006$ That means $f(2011)=65-2006=-1941$.

