Given a function f(x), we know its even part is given as $\frac{f(x)+f(-x)}{2}$ and its odd part is given by $\frac{f(x)-f(-x)}{2}$.

Consider a discrete sequence given by ${a}_{j}$ for $j\ge 1$, then the sum of the terms in the sequence till n terms is given as

$$S=\sum _{j}^{n}{a}_{j}$$

Suppose I wanted to get the sum of the even terms in the above expression; then

$${S}_{odd}=\sum _{j}^{n}\frac{{a}_{-j}+{a}_{j}}{2}$$

and, for odd,

$${S}_{odd}=\sum _{j}^{n}\frac{{a}_{j}-{a}_{-j}}{2}$$

But wait, our sequence was defined for $j\ge 1$. Well, here's the thing: ${a}_{j}$ is some function of j, extending the domain to negative integers and evaluating the function gives the right answer... but I can't understand why the continuous function trick extended to here.

Examples:

Sum of first n numbers given as $\frac{n(n+1)}{2}$, sum of first n odds will be given as: $\frac{n(n+1)}{2}-\frac{n(1-n)}{2}$

My attempt at finding an exact connection: To the discrete sequence $\frac{n(n+1)}{2}$, we can associate a function $f(x)=\frac{x(x+1)}{2}$ and we can think of the summation as summing this function at several different input points i.e:

$$S=\sum _{j}^{n}{a}_{j}\to \sum _{k}^{n}f(x+k)$$

Then we apply the even odd decomposition and return back to the sequence world.

My question: Does there exist an association for every sequence with a function? If not, what is the criterion for an association to exist?