Given a set of n particles electric charge carriers founds on the points (1,0), (2,0), .... (n,0) on a plane. The particle charge that found in point (i,0) is noted as Qi. the force that act on the particle is given by the formula:
Fi = $\sum_{j=1}^{i-1}\frac{CQiQj}{(i-j)^2}-$ $\sum_{j=i+1}^{n}\frac{CQiQj}{(i-j)^2}$
C is a Coulomb's constant.
Give an algorithm to calculate Fi, for all of the particles in total complexity O(nlgn). Hint: use FFT algorithm.
It seems that Fi is already divided to the even and odd points..
I thought about to divide each sum to calculate the FFT (but divide until what..?) and then sum always half of the points (cause this is what FFT cause) and then subtract the result of the sums that given on the formula..
any idea of how to do it better?