I am not sure if it is a useful question but would like to know if possible. Consider I have a random numbers $A=a_1, a_2,,a_n$. Now suppose, I do Fourier Transform of A (for example use fft command in matlab) and get $n$ Fourier coefficient $A_f=f_1,f_2,..,f_n$
Now, I want to know how to generate a sequences say $B=b_1,b_2...,b_n$ (but not A) so that performing Fourier transform of B gives one coefficient same say the second coefficient $f_2$ There are infinite sequence which would give the same Fourier coefficient $f_2$ but the question is which is the one closest distance from A in some sense. Distance may be usual $L_2$ norm or other if such problem is solved.
The first Component, the DC component which is the mean of $A$ may be obtained by interchanging the small two numbers in the sequence A. Since the DC is not changed by interchanging the numbers in the sequence. The question how to get sequence such that other coefficients $f_2$, or $f_3$..or $f_n$ is nto changed.