To get somewhat decent O(nlogn) performance we can use a divide & conquer algorithm leaning on the formula's periodicity. As my primary source, https://lcamtuf.substack.com/p/not-so-fast-mr-fourier, quips: It literally goes around in circles!
We divide the sampled input by even & odd indices, recursing into both halves until we get a single sample to return directly.
We merge the results by pairing up even & odd results, calculating even ± odd*e^iτk/N for N samples at kth index.
3/4!