Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
@JetfiRex forget about everything, I messed up a little bit. Sorry for the confusion. I'll delete the previous comments to avoid further confusions. The answer to your original question is that the function that you suggested, i.e., $f(r)=2^{-r}\binom{n+1}{r}$ has a maxima only at $k$ when $n=3k+1$. But, the set you mentioned, i.e., $\{\lfloor\frac{n}{3}\rfloor,\lfloor\frac{n+1}{3}\rfloor,\lfloor\frac{n+2}{3}\rfloor\}=\{k-1,k\}$ gives two different values, namely $k-1$ and $k$. In particular, the maximizing set of the function is $\{\lfloor\frac{n+1}{3}\rfloor,\lfloor\frac{n+2}{3}\rfloor\}$.