Solving a Cournot oligopoly game with N firms This is the full question: Find all pure strategy Nash equilibria of the Cournot oligopoly game with $N$ firms facing linear demand $P = a − Q$ when the total cost for each firm is $c_i(q_i) = q_i^2$.

My understanding is that:

$$\pi_i = q_i(a − Q) - q_i^2$$

$$\max_{q_i} \quad q_i(a − Q) - q_i^2$$

Therefore, the FOC: 

$a - Q - 2q_i = 0$

This FOC can be derived for each firm. 

This is the part that I get stuck at. How do you add all the FOCs of $N$ firms together? Thank you!
Your FOC is wrong.

So $$\max_{q_i} \quad q_i(a − \sum_{j=1}^nq_j) - q_i^2$$

$$\implies \max_{q_i} \quad aq_i − q_i\sum_{j=1}^nq_j - q_i^2$$

The real FOC is

$$a - \sum_{j\neq i}q_j - 2q_i - 2q_i = 0.$$