$$ f(x) = sin(\pi x) $$
Find the correspondent Maclaurin series for the function $f(x)$.
Here's my approach:
Since Maclaurin series is defined as: $$ \sum_{n=0}^{\infty}\frac{f^{(n)}(0)}{n!}x^n $$
If I try to find a relation between $\frac{f^{(n)}(0)}{n!}$ for every $n^{th}$ derivative,and by doing that, I'll be able to define the correspondent Maclaurin series, and that's what I did:
$$ \frac{f(0)}{0!} = sin(\pi 0) = 0\\ \frac{f'(0)}{1!} = \pi cos(\pi 0) = \pi\\ \frac{f''(0)}{2!} = - \pi^2 sin(\pi 0) \cdot \frac{1}{2!} = 0\\ \frac{f^{(3)}(0)}{3!} = - \pi^3 cos(\pi 0) \cdot \frac{1}{3!} = \frac{-\pi^3}{6}\\ \frac{f^{(4)}(0)}{4!} = \pi^4 sin(\pi 0) \cdot \frac{1}{4!} = 0 $$
And then, since the following structure above is going to loop, I tried to find a pattern, and that's what I've got:
I saw that for every even number $n$, the equation of my series needs to return $0$.
I also saw that the sequence of numbers $A = \left\{ -1,3,7,11...\right\}$ defined by $$ A_n = -1 + 4n \text{ \ } \forall n \ge 0 $$ is the only possible numbers, besides $-1$, where my $n^{th}$ term of my series will have a negative value, hence when $n \in A$ we'll have a negative sign.
And of course, saw that the absolute value of $\frac{f^{(n)}(0)}{n!}$ is going to follow: $$ \frac{\pi^n}{n!} $$
Now my point is, how can I express that patterns in terms of $n$ in one equation to substitute $\frac{f^{(n)}(0)}{n!}$ ?
The best that I've got is:
$$ \sum_{n=0}^{\infty} \frac{(\pi x)^n}{n!} \cdot \left( \begin{cases} 0 & \text{ if } n\text{ mod }2 = 0\\ -1 & \text{ if } n \in A\\ 1 & \text{ otherwise} \end{cases} \right) $$
As @MPW suggested, consider even indices $n=2k$ and odd induces $n=2k+1$ separately. Here $k$ will be a new running index, just like $n$ is. (Note that if $k=0,1,2,\ldots$, then $n=2k$ runs through all nonnegative even integers, and $n=2k+1$ runs through all nonnegative odd integers.)
For brevity, let $s(n)$ denote your function determining the sign for the three possible cases: $$s(n)=\begin{cases} 0 & \text{ if } n\text{ mod }2 = 0\\ -1 & \text{ if } n \in A\\ 1 & \text{ otherwise} \end{cases}$$
Since for all even $n$, the corresponding coefficient is zero, those terms can be dropped from summation, and it can be rewritten as $$\sum_{n=0}^{\infty} \frac{(\pi x)^n}{n!} \cdot s(n)=\sum_{n=0\\n\text{ odd}}^{\infty} \frac{(\pi x)^n}{n!} \cdot s(n)=\sum_{k=0}^{\infty} \frac{(\pi x)^{2k+1}}{(2k+1)!} \cdot s(2k+1),$$ by substituting $n=2k+1$ for odd $n$. (See the note in the first paragraph.)
Next, notice that for odd-numbered terms, the signs $+$ or $-$ alternate: $$ \begin{array}{l|ccccc} k & 0 & 1 & 2 & 3 & \cdots \\ \hline n=2k+1 & 1 & 3 & 5 & 7 & \cdots \\ \hline s(n)=s(2k+1) & 1 & -1 & 1 & -1 & \cdots \end{array} $$ You can notice that $s(2k+1)=(-1)^k$, which is a pretty standard way to indicate alternating signs, and it will give you the pretty standard expression for the final answer $$\sin(\pi x)=\sum_{k=0}^{\infty} \frac{(\pi x)^{2k+1}}{(2k+1)!} \cdot (-1)^k=\sum_{k=0}^{\infty} \frac{(-1)^k\pi^{2k+1}}{(2k+1)!}x^{2k+1}.$$