Find determinant of the matrix NxN We are given matrix $M_{n,n}$, where
$m_{ij} = \begin{cases} a_i \cdot a_j,\ \mbox{if}\ i \ne j \\a_i^2+k,\ \mbox{if}\ i=j \end{cases}$  
Hence, M gotta look like that:
$ \left( \begin{array}_
a_1^2+k & a_1a_2 & ... & a_1a_n  \\
a_2a_1 & a_2^2+k & ... & a_2a_n  \\
... &... &... & ... &\\
a_na_1 & a_na_2 & ... & a_n^2+k \end{array} \right)$  
I would like to find the determinant. Any suggestion?

If you replace $k$ with $-\lambda$, the determinant you are looking for is the characteristic polynomial of 
$$
(a_i\cdot a_j)_{ij}=B^TB,\ \ \  \text{ where }B=[a_1\ a_2\cdots a_n].
$$
Now note that $BB^T=a_1^2+\cdots +a_n^2$ has rank one, and so $B^TB$ has rank one too. This means that it has one nonzero eigenvalue and then zero with multiplicity $n-1$. The nonzero eigenvalue agrees with that of $BB^T$ (or we can also notice that it has to agree with the trace of $B^TB$).
Thus, the characteristic polynomial of $B^TB$ is $(-\lambda)^{n-1}(a_1^2+\cdots +a_n^2-\lambda) $. We conclude that
$$
\det A=k^{n-1}(a_1^2+\cdots +a_n^2+k).
$$
Note also that this gives us more information, in the sense the eigenvalues of $A$ are precisely $k$ with multiplicy $n-1$ and $k+a_1^2+\cdots+a_n^2$ with multiplicity $1$. 
