Sometimes the truncated Fourier series of a function with Fourier coefficients $\hat{u}_k$ is written
$$\sum_{k=-N}^N\hat{u}_ke^{ikx}$$
which is a linear combination of $\cos(nx) +i\sin(nx)$ for integers $|n|\le N$. Sometimes, however, the truncated Fourier series is written
$$\sum_{k=-N/2}^{N/2-1}\hat{u}_ke^{ikx}$$
which is a linear combination of $\cos(nx/2) +i\sin(nx/2)$ for integers $-N\le n\le N-2$.
What motivates using the latter less-intuitive indices? Are both series given above the same? Functions such as $\cos(nx/2)$ for odd $n$ are not even periodic on $[0,2\pi]$.