How many ways are there to select $k$ elements from the set $[n]$ such that the numbers selected differ by at least three?
I thought of considering two cases: $n-k$ is even or $n-k$ is odd. If $n-k$ is even, then I arrived at ${\frac{n-k}{2}+1}\choose{k}$ ways and if $n-k$ is odd, then there are ${\left\lfloor \frac{n-k}{2} \right\rfloor +1} \choose {k}$ possibilities. To answer this question, I was analysing the ways of choosing k elements from the empty spaces that exist when considering an array on $n-k$ $\textbf{0's}$. Any suggestions for a better argument and what's the answer for a more general case: the k selected numbers should differ by at least $d$ ?
The method that comes to my mind is similar to this: https://math.stackexchange.com/a/1396968/473276. Count the number of functions $f: [k] \to [n]$ such that $f(i + 1) \ge f(i) + 3$ for all $i$ (these functions correspond exactly to subsets of size $k$ with all elements differing by at least $3$). Observe that $f$ is such a function if and only if the function $g: [k] \to [n - 2k + 2]$ given by $g(i) = f(i) - 2i + 2$ is strictly increasing.
So the total number of such functions is $\binom{n - 2k + 2}k$. (Take this to be $0$ if $n - 2k + 2 < k$).
This obviously generalises to $\binom{n - (d - 1)k + d - 1}k$.
PS: if $k = 1$, the answer should be $n$, right? Your formula gives $\binom{\frac{n - 1}2 + 1}{1} = \frac{n - 1}2 + 1$, which is smaller in general.