In this entire discussion, let $k,r,N,N_0,m,n \in \mathbb{Z}$.
Derivation of DFT for a cosine signal sampled exactly $p$ periods
The DFT of a discrete time signal $x[k]$ with length $N_0$ is defined as
$$X[r] = \sum_{k=0}^{N_0-1}x[k]e^{-jr\Omega_0 k}, \; \; \; \Omega_0 = \frac{2\pi}{N_0} \tag1$$
where we only need to perform calculations for $r \in [0, N_0-1]$ because the DFT is $N_0$-periodic in $r$ ($2\pi$-periodic in $\Omega$).
We know from continuous time that
$$\int_{T} \cos(n\omega_0 t)\cos(m\omega_0 t) \: \text{d}t = \begin{cases} 0 \: \: \: n \neq m \\\\ \frac{T}{2} \: \: \: n = m\end{cases} \tag2$$ $$\int_{T} \cos(n\omega_0 t)\sin(m\omega_0 t) \: \text{d}t = 0 \: \: \: \text{for all n and m} \tag3$$
where $T$ denotes one period. The discretized versions are
$$\sum_{k=0}^{N-1} \cos(n\Omega k)\cos(m\Omega k) = \begin{cases} 0 \: \: \: n \neq m \\\\ \frac{N}{2} \: \: \: n = m, \; \; \; \Omega \neq \pm \pi \\\\ N \: \: \: n = m, \; \, \; \Omega = \pm \pi \end{cases} \tag4$$ $$\sum_{k=0}^{N-1} \cos(n\Omega k)\sin(m\Omega k) = 0 \: \: \: \text{for all n and m} \tag5$$
where $N$ denotes one period.
If the signal we are performing the DFT on is a cosine signal $x[k] = \cos(\Omega k), \Omega \in [-\pi, \pi)$, then
$$\begin{align*} X[r] &= \sum_{k=0}^{N_0-1}\cos(\Omega k)e^{-jr \Omega_0 k} \\\\ \tag6 X[r] &= \sum_{k=0}^{N_0-1}\cos(\Omega k)\cos(r\Omega_0 k) - i \sum_{k=0}^{N_0-1}\cos(\Omega k)\sin(r\Omega_0 k) \end{align*} $$
Note that $x[k]$ has period $N = \frac{2\pi}{\Omega}$. If we have sampled exactly $p$ periods of $x[k]$, that is, $N_0 = pN$, then $\Omega_0 = \frac{2\pi}{pN}$ and equation $(6)$ becomes
$$X[r] = p\sum_{k=0}^{N-1}\cos(\Omega k)\cos(r\Omega_0 k) - ip \sum_{k=0}^{N-1}\cos(\Omega k)\sin(r\Omega_0 k) \tag7$$
Applying $(5)$ on $(7)$ removes the second sum
$$X[r] = p\sum_{k=0}^{N-1}\cos(\Omega k)\cos(r\Omega_0 k) \tag8$$
Substituting $\Omega = \frac{2\pi}{N}$ and $ \Omega_0 = \frac{2\pi}{pN} $ we are left with
$$X[r] = p\sum_{k=0}^{N_0-1}\cos\bigg(\frac{2\pi}{N} k \bigg)\cos \bigg(\frac{r}{p} \frac{2\pi}{N} k \bigg) \tag8$$
Here, we need to consider two cases: When $\Omega \neq \pm \pi$, that is, $N \neq 2, $or $\Omega = \pm \pi$, that is, $N = 2$.
In the special case where $\Omega = \pi$ we have only one value of $r$ with a non-zero result.
$$X[r] = p\sum_{k=0}^{1}\cos(\pi k)\cos(\frac{r}{p}\pi k) = \begin{cases}0 \; \; \; r \neq p \\\\ pN \; \; \; r = p \end{cases} \tag9$$
In the general case we have two values of $r$ yielding non-zero results. Recall that $\cos(\Omega k) = \cos( (-\Omega + 2\pi) k)$, which is equivalent to $\cos\bigg( (-\frac{2\pi}{N} + 2\pi) k \bigg) =\cos\bigg( (N-1)\frac{2\pi}{N}k \bigg)$.
This means that $(8)$ has two values of $r$ in $[0, N_0-1]$ that yields a non-zero result: $r=p$ and $\frac{r}{p}=N-1 \Rightarrow r = (N-1)p$.
Conclusion
The DFT of a time-discrete cosine signal $x[k] = \cos(\Omega k)$ with exactly $p$-periods of samples and length $N_0$ has one non-zero value if $\Omega = \pm \pi$ and two non-zeros values for the general case, when $r\in[0,N_0-1]$. More specifically $$X[r] = \sum_{k=0}^{N_0-1}x[k]e^{-jr\Omega_0 k} = \begin{cases} pN \; \; \; \Omega = \pm \pi , \; \; \; r = p \\\\ p\frac{N}{2} \; \; \; \Omega \neq \pm \pi, \; \; \; r = p \; \; \; \text{or} \; \; \; r = (N-1)p \\\\ 0 \; \; \; \text{otherwise}\end{cases}$$
This shows why the DFT of 500 Hz signal in the question has only two places where it is different from zero.