Does there exist a closed form for the $k, k\in\mathbb{Z^+}$, such that $\big|\big(\frac{n-1}{n}\big)^k-\frac{1}{2}\big|$ is minimal over $n\in\mathbb{Z^+}\setminus\{1\}$?
I came up with this problem while thinking about how many rolls of a $6$-sided die I would have to perform to have a $>\frac{1}{2}$ probability of rolling any given number, and thus win on average if giving even $1/1$ odds.
I've figured out that \begin{array} {|r|r|}\hline n & k \\ \hline 2 & 1 \\ \hline 3 & 2 \\ \hline 4 & 2 \\ \hline 5 & 3 \\ \hline 6 & 4 \\ \hline 7 & 5 \\ \hline 8 & 5 \\ \hline 9 & 6 \\ \hline 10 & 7 \\ \hline \end{array}
This implies to me that the answer should be approximately linear, with a slope of approximately $\frac{7-1}{10-2}=\frac{3}{4}$. But I don't know how I would solve this explicitly, nor how to show that any answer I do come up with would be correct. The only first step I could think of was expanding $\big(\frac{n-1}{n}\big)^k$ as $\big(1-\frac{1}{n}\big)^k$ and then expanding binomially, but I didn't get anywhere with that (unless I missed something, which is, after all, only too possible).
For fixed $n$, the function $\left|\left(\frac{n-1}{n}\right)^k-\frac{1}{2}\right|$ is a convex function of $k$, and so the minimum is obtained by rounding the continuous minimizer: $$k^*\in \left\{ \left\lfloor \frac{\log(1/2)}{\log((n-1)/n)}\right\rfloor, \left\lceil \frac{\log(1/2)}{\log((n-1)/n)}\right\rceil \right\}$$