Your question is at the core of not only signal processing but differential equations and orthogonal special functions, fields of study that have a long history and are still active and evolving, so it's a daunting task to point out where you could start your studies.
The Wiki leonbloy pointed out, Generalized Fourier Series, and also the Wiki Green's Function with the section on eigenvalue expansions introduce the jargon that you should be thoroughly familiar with.
The basic algorithm is to find dual sets of eigenvectors/eigenfunctions parametrized by a continuous (e.g., $\omega$ below) or discrete index (e.g., $n$ below), that satisfy completeness and orthogonality relations encapsulated in Dirac delta function resolutions such as that for the Fourier transform
$$\delta(x-y)= \int_{-\infty}^{\infty}\exp(i2\pi \omega x)\exp(i2\pi \omega y)d\omega$$
giving
$$\int_{-\infty}^{\infty}f(y)\delta(x-y)dy=f(x)=\int_{-\infty}^{\infty}\exp(i2\pi \omega x)\int_{-\infty}^{\infty}f(y)\exp(i2\pi \omega y) dy d\omega$$
$$=\int_{-\infty}^{\infty}\exp(i2\pi \omega x)\hat{f}(\omega) d\omega,$$
or that for the eigenvectors of Sturm-Liouville differential operators over finite domains
$$\delta(x-y)=\sum_{n=0}^{\infty }\Psi_n(x)\Psi_n^*(y)$$
giving
$$f(x)=\sum_{n=0}^{\infty }\Psi_n(x)\int_{-\infty}^{\infty}f(y)\Psi_n^*(y) dy,$$
or Kronecker delta resolutions such as that for the associated Laguerre functions
$$\frac{(n+\alpha)!}{n!}\delta_{mn}=\int_{0}^{\infty}x^{\alpha}e^{-x}L_{n}^{\alpha}(x)L_{m}^{\alpha}(x)dx$$
giving
$$f(x)=\sum_{n=0}^{\infty }\frac{n!L_{n}^{\alpha}(x)}{(n+\alpha)!}\hat{f}_n$$
with
$$\hat{f}_n=\int_{0}^{\infty}x^{\alpha}e^{-x}L_{n}^{\alpha}(x)f(x)dx.$$
The Fourier Transform and Its Applications by R. Bracewell is a really good book for grasping the fundamentals of the FT and DFT, as well as G. Strang's Introduction to Applied Mathematics.
Methods of Applied Mathematics by F. Hildebrand and Principles and Techniques of Applied Mathematics by B. Friedman give good intros to Fredholm theory and Green's functions.
More advanced books on harmonic analysis, such as J. Partington's Interpolation, Identification, and Sampling might be the next leap if you are comfortable with complex analysis (e.g., fractional linear transformations) and other integral transforms such as the Laplace transform.
Your question means nothing. Work on
$$\text{I}\Pi(x) = \sum_{k=-\infty}^\infty \delta(x-k) = 1+2 \sum_{n=1}^\infty \cos(2\pi n x)$$
where the Fourier series on the right converges only is in the sense of distributions, that is, for every $\varphi \in C_c^\infty$ with (*) compact support $[a,b]$ :
$$\langle \text{I}\Pi, \varphi \rangle = \int_{-\infty}^\infty \text{I}\Pi(x) \varphi(x) \, dx = \sum_{k \in \mathbb{Z} \cap [a,b]} \varphi(k)$$
$$=\lim_{N \to \infty} \langle 1+2 \sum_{n=1}^N \cos(2\pi n x), \varphi \rangle = \lim_{N \to \infty} \int_{-\infty}^\infty (1+2 \sum_{n=1}^N \cos(2\pi n x)) \varphi(x) \, dx$$
So what I mean is : there is no Fourier series for the Dirac delta, there is only a Fourier series for the Dirac comb $\text{I}\Pi(x)$.
And read a course on : the Fourier series and the Fourier transform, on the distributions, on some complex analysis and the Laplace/Mellin transform.
(*) Since $\text{I}\Pi(x)$ is tempered distribution of order $1$, you can extend $\langle \text{I}\Pi,\varphi \rangle$ to any $\varphi(x)$ continuous (at $x \in\mathbb{Z}$) and with compact support, or decreasing fast enough at $x \to \infty$.
For example, it is perfectly true that $\langle \text{I}\Pi(x) ,x^{-s}\Lambda(\lfloor x+1/2 \rfloor) \rangle = \sum_{n=1}^\infty n^{-s}\Lambda(n) = \frac{-\zeta'(s)}{\zeta(s)}$ for $Re(s) > 1$, but it doesn't mean that
$$\frac{-\zeta'(s)}{\zeta(s)} = \lim_{N\to \infty} \int_{1/2}^\infty x^{-s} \Lambda(\lfloor x+1/2 \rfloor)(1+2\sum_{n=1}^N \cos(2\pi n x)) \, dx$$
and this is all the point of the theory of distributions (and the theory of the Riemann zeta function) to study those kind of things.
Best Answer
The question is quite broad, but here is a possible relation between Fourier transformation and prime numbers.
We know that the Riemann zeta function is defined as $$\zeta(s) = \sum_{n=1}^\infty\frac{1}{n^s},$$ for all $\Re(s)>1$.
The second thing, that the Riemann zeta function is related to prime numbers via Euler product formula.
$$\zeta(s)=\sum_{n=1}^\infty\frac{1}{n^s} = \prod_{p \text{ prime}} \frac{1}{1-p^{-s}},$$
for all $\Re(s)>1$.
As a generalization of Riemann zeta function the Hurwith zeta function is defined as $$\zeta(s,q) = \sum_{n=0}^\infty \frac{1}{(q+n)^{s}},$$ for all $\Re(s)>1$ and $\Re(q)>0$. The Riemann zeta function is $\zeta(s,1)$.
Another way to generalize Riemann zeta function is using polylogarithm, which is defined as
$$\operatorname{Li}_s(z) = \sum_{k=1}^\infty {z^k \over k^s}.$$
For $\Re(s)>1$ we have $\operatorname{Li}_s(1)=\zeta(s)$. Is is also true, that $\operatorname{Li}_s(-1)= (2^{1-s}-1)\zeta(s)$.
The sequence of $N$ complex numbers $x_0,x_1,\dots,x_{N-1}$ is transformed with discrete Fourier transformation into an $N$-periodic sequence of complex numbers with
$$X_k\ =\ \sum_{n=0}^{N-1} x_n \cdot e^{-i 2 \pi k n / N}, \quad k\in\mathbb{Z}\,.$$
Of course by using Euler's formula we could also use trigonometric functions.
Here comes the connection. The discrete Fourier transform of the Hurwitz zeta function with respect to the order $s$ is the Legendre chi function, which is defined as $$\chi_s(z) = \sum_{k=0}^\infty \frac{z^{2k+1}}{(2k+1)^s}.$$ The Legendre chi function is related to polylogarithms as the following. $$\chi_s(z) = \frac{1}{2}\left[\operatorname{Li}_s (z) - \operatorname{Li}_s (-z)\right].$$
So it is also true that
$$\chi_s(1) = (1-2^{-s})\zeta(s),$$
for all $s>0$ real numbers.
So if we put this all together.
$$\prod_{p \text{ prime}} \frac{1}{1-p^{-s}} \stackrel{\text{DFT}}{\implies} (1-2^{-s})\prod_{p \text{ prime}} \frac{1}{1-p^{-s}},$$
for all $s>0$ real numbers.
I hope that my argument is right, it's just've come into my mind while reading your question. While doing the DFT at the end we've substituted $z=1$ into Legrende chi function.