Algorithm for selecting a sample that's as spread out as possible?
I assume that for dates $d_1\leq d_2\leq\cdots\leq d_n$ you want $k&gt;1$ samples of minimal total absolute distance from the ideal sample points $s_i=d_1+(i-1)(d_n-d_1)/(k-1)$, $i\in[k]$.

If you can repeat elements, just sample at $\operatorname{argmin}_{j\in[n]}|d_j-s_i|$ for each $i\in[n]$.

Without repeating elements the following dynamic program solves your problem in time $O(n^3)$ and space $O(n^2)$: let $M(i,j)$ be the minimal total absolute distance for $k-i+1$ samples chosen from $a_j,\ldots,a_n$ from the ideal samples $s_i,\ldots,s_k$. Distance $M$ satisfies
\begin{align*}
M(i,j) = 
\begin{cases}
  \min_{j\leq j'\leq n} |d_{j'}-s_i|+M(i+1,j'+1), &amp; \text{$i\leq k$, $j\leq n$, }\\
  0, &amp; \text{$i&gt;k$},\\
  \infty, &amp; \text{otherwise},
\end{cases}
\end{align*}
and $M(1,1)$ is the minimum solution value.