Consider the following problem: $$\max_{n\in\mathbb N}\;f(n)= \frac12 \left[v_0 \sum_{i=\lceil k_n \rceil}^n \binom{n}{i}p^i (1-p)^{n-i} + v_1\sum_{i=1}^{\lfloor k_n \rfloor}\binom{n}{i}q^i(1-q)^{n-i}\right]-nc, $$ where $$ k_n=\frac{\ln v_1-\ln v_0 + n\ln(8/3)}{\ln 6}, $$ and $v_0,v_1,p,q,c$ are parameters.
To find the optimal $n$, one could plug in specific values for the parameters and manually compute the value of $f(n)$ for each $n\in\mathbb N$, and then select the $n$ that yields the highest value. However, I wonder if there is a way to solve for the optimal $n$ as a function of the parameters without resorting to brute force computations.
If it makes it easier, I'm willing to assume that $v_0=v_1=1$, and that $k_n=\frac12 n$. But I would rather keep $p,q,c$ as general parameters.