Suppose we have vectors $\mathbf{a}=(a_1,a_2,...,a_n)$ and $\mathbf{b}=(b_1,b_2,...,b_n)$ where $\mathbf{a}$ is known and $\mathbf{b}$ is unknown.
For the purposes of this question assume $n=3$. Then the outer product of $\mathbf{a}$ and $\mathbf{b}$ is
$$\begin{bmatrix}a_1b_1 & a_1b_2 & a_1b_3\\a_2b_1 & a_2b_2 & a_2b_3\\a_3b_1 & a_3b_2 & a_3b_3 \end{bmatrix}$$
This matrix is not fully known, but the sums of the diagonals are known. So we have the system of equations
$$c_1=a_1b_1$$ $$c_2=a_2b_1+a_1b_2$$ $$c_3=a_3b_1+a_2b_2+a_1b_3$$ $$c_4=a_3b_2+a_2b_3$$ $$c_5=a_3b_3$$
where $c_1,...,c_5$ are known.
The goal is to solve for the elements of $\mathbf{b}$.
Obv this can be done by hand for small $n$ but I am hoping someone can tell me the fastest method to do this for large $n$. Preferably something that doesn't require writing an iterative solver in R or a huge system of equations in Mathematica.