Take a periodic function on $\mathbb{R}$. The the fourier expansion is a series, so a "sum over $\mathbb{Z}$". But in case of a non-periodic function on $\mathbb{R}$, the fourier expansion is an integral, so a "sum over $\mathbb{R}$" (When the function on $\mathbb{R}$ is periodic then the fourier expansion is also an integral with delta functions, so a series, but this is more another way of saying the same thing I think ).
My question is: what is the reason that with a periodic function you get a series, so a sum over $\mathbb{Z}$, and not an integral (if we skip the delta functions formulation), like we get with non-periodic functions? Why is a series "enough" for a periodic function, and is for a non-periodic function on $\mathbb{R}$ an integral needed, so a "sum over $\mathbb{R}$"?
This is a classical topic in Harmonic analysis. You can look at a periodic function as a function on $\mathbb{R}$ which is invariant w.r.t. to the action of an abelian group isomorphic to $\mathbb{Z}$ which is discrete. What you call "non-periodic" functions can be seen as $\mathbb{R}-$periodic functions and $\mathbb{R}$ is a continuous abelian group. Hence the difference is related to the nature (continuous or discrete) of the acting group.